Search code examples
node.jsnpmnestjs

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. Tried to use yarn instead of npm, it resolved my problem, but i need all packages to be installed by npm


Solution

  • So, I resolved this problem, with deleting node_modules, package-lock.json and removing dependencies and devDependencies in package.json

    After i've installed all dependencies manually one by one