Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save caisback/acf7e31561fbb67d8d598f345daeb47e to your computer and use it in GitHub Desktop.
Save caisback/acf7e31561fbb67d8d598f345daeb47e to your computer and use it in GitHub Desktop.
NestJs - npm ERR! ERESOLVE unable to resolve dependency tree

Problem:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

$ npm i --save @nestjs/microservices
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: x-app@0.0.1
npm ERR! Found: @nestjs/common@8.4.6
npm ERR! node_modules/@nestjs/common
npm ERR!   @nestjs/common@"^8.0.0" from the root project
npm ERR!   peer @nestjs/common@"^8.0.0" from @nestjs/microservices@8.4.6
npm ERR!   node_modules/@nestjs/microservices
npm ERR!     @nestjs/microservices@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^7.0.0" from @nestjs/core@7.6.18
npm ERR! node_modules/@nestjs/core
npm ERR!   @nestjs/core@"^7.5.5" 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.

Resolution (Fixed):

Update NestJs to latest

- $ npm install -g @nestjs/cli npm-check-updates
- $ nest update --force
- Open NestJs project
  - $ npm-check-updates "/@nestjs*/" -u
  - $ npm-check-updates "/nestjs*/" -u    
  - $ npm install
@magdalena-dering
Copy link

Thanks a lot!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment