首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在节点模块安装过程中解析依赖树类型和nestjs

如何在节点模块安装过程中解析依赖树类型和nestjs
EN

Stack Overflow用户
提问于 2022-11-26 19:58:53
回答 2查看 17关注 0票数 0

在安装Nest Application节点模块期间,我有以下错误:

代码语言:javascript
复制
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的依赖项部分。

代码语言:javascript
复制
"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"
  }

我试图从package.json中删除“type from”:"^0.2.45“,但是我有相同的类型错误:

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-11-27 04:41:32

@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兼容的typeorm版本。

票数 0
EN

Stack Overflow用户

发布于 2022-12-03 18:11:47

我的固定版本:

"@nestjs/typeorm": "8.0.3"

现在起作用了,谢谢你

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74585212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档