在安装一个Nest Application节点模块时,我有以下错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ticket-be@0.1.3
npm ERR! Found: typeorm@0.2.45
npm ERR! node_modules/typeorm
npm ERR! typeorm@"^0.2.45" from the root project
npm ERR! peer typeorm@"^0.2.25" from @nestjs-query/query-typeorm@0.30.0
npm ERR! node_modules/@nestjs-query/query-typeorm
npm ERR! @nestjs-query/query-typeorm@"^0.30.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typeorm@"^0.3.0" from @nestjs/typeorm@8.1.4
npm ERR! node_modules/@nestjs/typeorm
npm ERR! @nestjs/typeorm@"^8.0.3" from the root project
npm ERR! peer @nestjs/typeorm@"^8.0.0" from @nestjs-query/query-typeorm@0.30.0
npm ERR! node_modules/@nestjs-query/query-typeorm
npm ERR! @nestjs-query/query-typeorm@"^0.30.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
你能给我一些解决依赖的建议吗?或者是使用——武力还是——传统的同行深度?提前谢谢你。
这里是我的package.json的dependencies部分
"dependencies": {
"@nestjs-modules/mailer": "^1.6.1",
"@nestjs-query/query-typeorm": "^0.30.0",
"@nestjs/common": "^8.4.4",
"@nestjs/config": "^2.0.0",
"@nestjs/core": "^8.0.0",
"@nestjs/jwt": "^8.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/passport": "^8.2.1",
"@nestjs/platform-express": "^8.0.0",
"@nestjs/swagger": "^5.2.1",
"@nestjs/typeorm": "^8.0.3",
"@types/bcrypt": "^5.0.0",
"@types/cookie-parser": "^1.4.2",
"bcrypt": "^5.0.1",
"class-transformer": "^0.4.0",
"class-validator": "^0.13.2",
"cookie-parser": "^1.4.6",
"fastify-swagger": "^5.1.0",
"handlebars": "^4.7.7",
"joi": "^17.6.0",
"passport": "^0.5.2",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"pdfmake": "^0.2.5",
"pg": "^8.7.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"swagger-themes": "^1.2.22",
"swagger-ui-express": "^4.3.0",
"typeorm": "^0.2.45",
"uuid": "^8.3.2",
"webpack": "^5.72.1"
}
我试图删除" typeor"; "^0.2.45"从包中。json,但我有相同的类型错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ticket-be@0.1.3
npm ERR! Found: typeorm@0.3.10
npm ERR! node_modules/typeorm
npm ERR! peer typeorm@"^0.3.0" from @nestjs/typeorm@8.1.4
npm ERR! node_modules/@nestjs/typeorm
npm ERR! @nestjs/typeorm@"^8.0.3" from the root project
npm ERR! peer @nestjs/typeorm@"^8.0.0" from @nestjs-query/query-typeorm@0.30.0
npm ERR! node_modules/@nestjs-query/query-typeorm
npm ERR! @nestjs-query/query-typeorm@"^0.30.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typeorm@"^0.2.25" from @nestjs-query/query-typeorm@0.30.0
npm ERR! node_modules/@nestjs-query/query-typeorm
npm ERR! @nestjs-query/query-typeorm@"^0.30.0" from the root project
@nestjs/typeorm@8.1.4
要求使用typeorm@^0.3.0
,但@nestjs-query/query-typeorm@"^0.30.0"
要求使用typeorm@^0.2.25
。您需要将@nestjs/typeorm
降级为与@nestjs-query/query-typeorm
兼容的版本,或将@nestjs-query/query-typeorm
升级为与@nestjs/typeorm@^8.1.4
具有兼容的字体版本
我修正了版本:
"@nestjs/typeorm": "8.0.3"
现在它工作了,谢谢@jay-mcdoniel