简体   繁体   English

npm 错误! 安装@nest/microservices 时ERESOLVE 无法解析依赖树

[英]npm ERR! ERESOLVE unable to resolve dependency tree when installing @nest/microservices

I'm trying to install new dependency to my service,我正在尝试为我的服务安装新的依赖项,

@nest/microservices: ^7.0.3 and got this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: vb-service-ads@0.0.1
npm ERR! Found: @nestjs/common@8.4.7
npm ERR! node_modules/@nestjs/common
npm ERR!   @nestjs/common@"^8.4.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^7.0.0" from @nestjs/microservices@7.6.18
npm ERR! node_modules/@nestjs/microservices
npm ERR!   @nestjs/microservices@"^7.0.3" from the root project
npm ERR! 

so versions of packages with problem are:所以有问题的软件包版本是:

"@nestjs/common": "^8.4.7",
"@nestjs/core": "^7.6.15"

I tried to upgrade versions of core and microservices dependencies to ^8.0.0, and got more dependencies broken and also tried to downgrade common to ^7.6.15 and got same effect.我尝试将核心和微服务依赖项的版本升级到 ^8.0.0,并且破坏了更多依赖项,还尝试将 common 降级到 ^7.6.15 并获得了相同的效果。 Tried to use yarn instead of npm, it resolved my problem, but i need all packages to be installed by npm尝试使用 yarn 而不是 npm,它解决了我的问题,但我需要 npm 安装所有包

you can see the solution here, or at least this is what worked for me here.你可以在这里看到解决方案,或者至少这对我有用。 https://www.angularjswiki.com/angular/unable-to-resolve-dependency-tree-error-in-angular-while-installing-npm-packages/ https://www.angularjswiki.com/angular/unable-to-resolve-dependency-tree-error-in-angular-while-installing-npm-packages/

I leave you the part where it worked for me我把对我有用的部分留给你

To fix Unable to resolve dependency tree error in Angular while installing npm packages follow the below steps.要在安装 npm 软件包时修复 Angular 中的无法解析依赖树错误,请按照以下步骤操作。

  1. Run npm install --save --legacy-peer-deps instead of npm install command.运行npm install --save --legacy-peer-deps而不是npm install命令。 Another way is delete the node_modules folder and package_lock.json file and then另一种方法是删除node_modules文件夹和 package_lock.json 文件,然后
  2. Run npm cache clean --force after npm i --force command.npm i --force命令之后运行npm cache clean --force

So, I resolved this problem, with deleting node_modules, package-lock.json and removing dependencies and devDependencies in package.json所以,我通过删除 node_modules、package-lock.json 并删除 package.json 中的依赖项和 devDependencies 解决了这个问题

After i've installed all dependencies manually one by one在我一一手动安装所有依赖项之后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 npm 安装 - ERESOLVE 无法解析依赖树 - npm install - ERESOLVE unable to resolve dependency tree Heroku Shopify 应用程序错误 'npm ERR! ERESOLVE 无法解析依赖树' - Heroku Shopify Application Error 'npm ERR! ERESOLVE unable to resolve dependency tree' 为什么错误? ERESOLVE unable to resolve dependency tree 被抛出,如何解决? - Why ERR! ERESOLVE unable to resolve dependency tree is thrown and how to resolve it? 安装依赖项产生:ERESOLVE unable to resolve dependency tree - Installing dependency produces: ERESOLVE unable to resolve dependency tree ERESOLVE 无法解析依赖树 - ERESOLVE unable to resolve dependency tree npm ERESOLVE 无法解析依赖树 NestJs Passport - npm ERESOLVE unable to resolve dependency tree NestJs Passport 安装 AWS CDK 构造库时出现“ERESOLVE 无法解析依赖关系树” - “ERESOLVE unable to resolve dependency tree” when installing AWS CDK construct library ERESOLVE 无法解析 redux 的依赖关系树 - ERESOLVE unable to resolve dependency tree for redux npm 错误。 代码 ERESOLVE npm 错误! ERESOLVE 无法解析。 当我运行 npm 安装时 - npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve. When I ran npm install 获取 npm 错误! 当我在我的节点项目中提供 npm install 时,ERESOLVE 无法解决 - Getting npm ERR! ERESOLVE could not resolve when I give npm install in my node project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM