Fix: npm ERR! code ERESOLVE
Step-by-step fix for 'npm ERR! code ERESOLVE' dependency conflict errors when installing OpenClaw.
This page helps you fix dependency resolution conflicts during npm install.
🔴 Raw Error Log (What You Actually See)
You may see errors like:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: some-package@1.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from some-other-package@2.0.0If your error looks similar, you are in the right place.
🔍 Why This Happens (Root Cause)
This error occurs when two packages require different versions of the same dependency.
For example:
- OpenClaw requires
react@18 - Some plugin requires
react@17 - npm can't satisfy both requirements simultaneously
✅ How to Fix It (Step-by-Step)
Step 1 — Use Legacy Peer Dependencies (Recommended)
Force npm to use the older, more lenient dependency resolution:
npm install --legacy-peer-depsThis tells npm to ignore strict peer dependency requirements.
Step 2 — If Step 1 Fails, Force Install
npm install --force⚠️ Use
--forceonly if--legacy-peer-depsdoesn't work. It may cause runtime issues.
Step 3 — Clean Install (If Still Failing)
rm -rf node_modules package-lock.json
npm cache clean --force
npm install --legacy-peer-deps🔎 Verify the Fix
After applying the fix, run:
npm run start✅ Expected Result
OpenClaw starts without errors:
> OpenClaw@1.0.0 start
> node server.js
Server running on http://localhost:3000
OpenClaw is ready! 🚀❌ Still Not Working?
If you see different errors after fixing ERESOLVE:
- Runtime crashes: Try
npm install --forceinstead - Module not found: Check Fix: Cannot find module
🧭 Advanced Notes
For Development Teams:
Add this to your project's .npmrc file to set legacy mode as default:
legacy-peer-deps=true
This ensures all team members use the same resolution strategy.
🔗 Related: Common Errors Summary | Error Dictionary
Internal Ref: ERROR_INSTALL_003