[BUG] `npm audit fix` installes incompatible peer dependencies
Open
Nobody has claimed this yet.
Bug
Priority 2
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
This is not just a request to bump a dependency for a CVE
- This is not solely a request to bump a dependency for a CVE
Current Behavior
I run npm audit fix, npm warns about "npm warn ERESOLVE overriding peer dependency"
Expected Behavior
Run the npm audit fix subcommand to automatically install compatible updates to vulnerable dependencies.
(Highlight by me)
Steps To Reproduce
Run npm audit fix
Environment
- npm: 11.16.0
- Node.js: v24.18.0
- OS Name: Debian forky/sid
- System Model Name: N/A
- npm config:
; "builtin" config from /usr/share/nodejs/npm/npmrc
prefix = "/usr/local"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with the attached package.json and package-lock.json by running npm audit fix, and capture the ERESOLVE warning and resulting dependency changes. Trace how the audit fix command selects updates and resolves peer dependencies; done means vulnerable dependencies are updated without installing incompatible peer dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100