微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Typescript 项目通过运行 TSC 编译错误

如何解决Typescript 项目通过运行 TSC 编译错误

我从打字稿开始。我已经创建了节点模块,nodemon ......测试过程“npm run test”工作正常。当我尝试用 tsc 编译时,虽然在目录中创建了 dist 文件夹,但这些错误出现在下面。

src/entity/Cliente.ts:1:92 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations.    

1 import { Column,Entity,PrimaryGeneratedColumn,CreateDateColumn,UpdateDateColumn } from "typeorm";            
src/entity/Cliente.ts:2:35 - error TS2307: Cannot find module 'type-graphql' or its corresponding type declarations.    

2 import { Field,ObjectType } from 'type-graphql';
src/entity/Cliente.ts:3:33 - error TS2307: Cannot find module '../interfaces/OrigemInterface' or its corresponding type declarations.    

3 import { OrigemInterface } from "../interfaces/OrigemInterface";
src/index.ts:2:56 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations.    

2 import { createConnection,getConnectionoptions } from "typeorm"
src/index.ts:3:21 - error TS2307: Cannot find module 'express' or its corresponding type declarations.    

3 import express from "express"
src/index.ts:4:30 - error TS2307: Cannot find module 'apollo-server-express' or its corresponding type declarations.    

4 import { ApolloServer } from "apollo-server-express"  
src/index.ts:5:29 - error TS2307: Cannot find module 'type-graphql' or its corresponding type declarations.    

5 import { buildSchema } from "type-graphql"
src/index.ts:16:5 - error TS2580: Cannot find name 'process'. Do you need to install type deFinitions for node? Try `npm i --save-dev @types/node`.

6     process.env.NODE_ENV || "development"
Found 8 errors.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。