cli
cli copied to clipboard
[BUG] Unable to update dependency and peer dependency at the same time
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
When updating multiple dependencies at the same time by updating their version in package.json and running npm install The following error will be shown if one of the dependencies being updated is a peerDependency of another dependency that is being updated which has updated the peerDependency version.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @semantic-release/[email protected]
npm ERR! node_modules/@semantic-release/apm-config
npm ERR! dev @semantic-release/apm-config@"^9.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @semantic-release/apm-config@"^9.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/semantic-release
npm ERR! peer semantic-release@">=18.0.0" from @semantic-release/[email protected]
npm ERR! node_modules/@semantic-release/apm-config
npm ERR! dev @semantic-release/apm-config@"^9.0.1" 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!
npm ERR! See /tmp/renovate-cache/others/npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/renovate-cache/others/npm/_logs/2021-09-22T03_55_08_332Z-debug.log
If one of the dependencies is updated first with the --force flag then the other dependency is updated without the --force flag it works fine.
Expected Behavior
installs dependencies
Steps To Reproduce
- Create new folder
- Run
npm init -y - Run
npm i semantic-release@^17 @semantic-release/apm-config@^8 - Change versions in package.json to
"semantic-release": "^18.0.0"and"@semantic-release/apm-config": "^9.0.0" - Run
npm i
Environment
- OS: Windows 10
- Node: 14.17.6
- npm: 7.24.0
Reproduction without manual version change in package.json:
npm init -y
npm i lexical @lexical/react
npm i --save-exact [email protected] @lexical/[email protected]