Typescript NestJS/Prisma给出了;错误调试失败“;没有任何其他信息
运行我的第一个非常小的NestJs/PrismaORM应用程序并启动它,我得到以下信息:Typescript NestJS/Prisma给出了;错误调试失败“;没有任何其他信息,typescript,nestjs,prisma,Typescript,Nestjs,Prisma,运行我的第一个非常小的NestJs/PrismaORM应用程序并启动它,我得到以下信息: /Users/bert/Project/helloworld-api_> nest start --debug Error Debug Failure. /Users/bert/Project/helloworld-api_> (错误为红色背景) 在哪里可以找到有关错误消息的更多信息? 我肯定这是我的错误,但如果NestJS能给我更多的信息就好了 完整地说,我的tsconfig.jso
/Users/bert/Project/helloworld-api_> nest start --debug
Error Debug Failure.
/Users/bert/Project/helloworld-api_>
(错误为红色背景)
在哪里可以找到有关错误消息的更多信息?
我肯定这是我的错误,但如果NestJS能给我更多的信息就好了
完整地说,我的tsconfig.json如下所示:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true
}
}
package.json中的相关部分是:
"dependencies": {
"@nestjs/common": "^7.6.13",
"@nestjs/core": "^7.6.13",
"@nestjs/platform-express": "^7.6.13",
"@prisma/client": "^2.18.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.6.6"
},
"devDependencies": {
"@nestjs/schematics": "^7.2.7",
"@nestjs/testing": "^7.6.13",
"@types/express": "^4.17.11",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.31",
"@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
"eslint": "^7.20.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"prisma": "^2.18.0",
"supertest": "^6.1.3",
"ts-jest": "^26.5.2",
"ts-loader": "^8.0.17",
"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.1.5"
},
希望你们能帮我,因为我有点困在这里了
谢谢
Bert我仍然不知道错误的根本原因,因为目前是使用
typescript@next
并利用将成为typescript@4.3.0
我仍然不知道错误的根本原因,目前正在使用typescript@next
并利用将成为typescript@4.3.0
解决方案是重建项目中与Prisma有关的所有内容。
因此:
- 卸下节点U模块
- 从package.json中删除Prisma和Prisma客户端
- npm安装
- npm i prisma和prisma客户
- 重建模块、控制器和服务
但话虽如此,杰伊·麦克唐尼尔提供的解决方案显然是真正的解决方案,所以请投杰伊的一票。:-) 解决方案是重建项目中与Prisma有关的一切。 因此:
- 卸下节点U模块
- 从package.json中删除Prisma和Prisma客户端
- npm安装
- npm i prisma和prisma客户
- 重建模块、控制器和服务
但话虽如此,杰伊·麦克唐尼尔提供的解决方案显然是真正的解决方案,所以请投杰伊的一票。:-) 我也遇到过类似的问题,但上面写的没有帮助。 因此,在需要使用PrismaService的服务中,我将代码更改为
constructor(
@Inject(PrismaService) private prisma
) { }
而不是
constructor(
private prisma: PrismaService
) { }
我也遇到过类似的问题,但上面写的没有帮助。 因此,在需要使用PrismaService的服务中,我将代码更改为
constructor(
@Inject(PrismaService) private prisma
) { }
而不是
constructor(
private prisma: PrismaService
) { }