In our code, we use node 14.17.6 and want to upgrade v18.16.1. But when we upgrade and run npm install
it is showing following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nestjs/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ts-morph
npm ERR! ts-morph@"^10.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ts-morph@"^13.0.2 || ^14.0.0 || ^15.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"^10.1.1" from the root project
npm ERR! peer @nestjs/graphql@"^10.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"^10.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/ts-morph
npm ERR! peerOptional ts-morph@"^13.0.2 || ^14.0.0 || ^15.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"^10.1.1" from the root project
npm ERR! peer @nestjs/graphql@"^10.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"^10.1.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.
npm ERR!
I have updated ts-morph
from 10.1.0
to 13.0.2
. But not working, it then showing other dependency error.
our current version:
"@apollo/gateway": "^2.1.1",
"@nestjs/apollo": "^10.1.0",
"@nestjs/common": "^9.0.11",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.11",
"@nestjs/graphql": "^10.1.1",
"@newrelic/apollo-server-plugin": "^2.0.1",
"apollo-server-express": "^3.10.2",
"apollo-server-plugin-query-complexity": "^1.0.0",
"graphql": "^16.6.0",
I have also used ncu
and try following ncu -u
. It is updating all npm package version. Then run npm i
, but not working.
It shows following result:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"^12.0.7" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @nestjs/apollo@"^12.0.7" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! peer @nestjs/common@"^9.3.8 || ^10.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"^12.0.7" 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.
Sometimes it is extremely hard to resolve dependency if you are trying to update every package to the latest version. If you are using VS code, first install Version Lens in vs code, then try to update npm version to
statisfies
notlatest
. I believe you will be able to upgrade everything.