npm ERR! code ERESOLVE: what it means and how to fix it
Some packages say "I only work with version X of another package" (a peer dependency). Your project asks for a different version, so npm stops instead of guessing. The message lists which package wants what; that list is the real clue.
The error looks like this:
npm ERR! code ERESOLVE
How to fix it
- Read the top of the message. Find the lines that start with
Found:andCould not resolve dependency. They name the package you have and the one that wants something else. - Try the clean fix first. Update or choose a version of the package the message names so both sides agree, then run
npm installagain. If an AI tool added the package, ask it for a version that matches your other packages. - If you must move on, loosen the check. Run
npm install --legacy-peer-deps. This makes npm ignore peer dependencies completely, so it can hide a real mismatch. Treat it as a temporary workaround and test the app afterwards. - Avoid
--forceas a habit. The npm docs describe--forceas switching off many safety checks, not only this one. Use it only if you understand what it overrides.
What you should see
The install finishes and a node_modules folder appears. With --legacy-peer-deps npm stays quiet about the conflict, so run your app and check that it starts.
Not fixed? Bring the exact message to Bilo and we will look at it with you.
Still stuck? Paste your error into BiloQuick questions
Is --legacy-peer-deps safe?
It is a workaround, not a repair. npm stops enforcing what packages say they need, so something may break later. Prefer matching versions when you can.
Why did it work on my friend's computer?
Older npm versions (3 to 6) ignored peer conflicts, and the same project can resolve differently with different npm versions or lock files. Check npm -v on both.
Can I make this error stricter instead?
Yes. The strict-peer-deps setting turns even small peer conflicts into failures. You usually do not need it as a beginner.
Sources and date checked
- npm config: legacy-peer-deps, force, strict-peer-deps: https://docs.npmjs.com/cli/v11/using-npm/config (checked 2026-11-01)
Written in our own words from the official pages above. Tool names are only references; we are not affiliated with them. Commands change between versions, so check the linked docs if something differs.