[英]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 中的无法解析依赖树错误,请按照以下步骤操作。
- Run
npm install --save --legacy-peer-deps
instead ofnpm install
command.运行
npm install --save --legacy-peer-deps
而不是npm install
命令。 Another way is delete thenode_modules
folder and package_lock.json file and then另一种方法是删除
node_modules
文件夹和 package_lock.json 文件,然后- Run
npm cache clean --force
afternpm 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.