npm ERR! code EBADPLATFORM — notsup Unsupported platform for fsevents: wanted {"os":"darwin"} (current: {"os":"linux"})
A package restricted to certain OS/CPU was installed as a required (not optional) dependency on another platform.
Seen on:
npm
Meaning
fsevents is macOS-only and should be optional. Errors appear with old npm, --force installs, or packages listing it as a direct dependency.
Common causes
- Platform-specific package listed as a direct dependency
- Old npm treating optional deps as required
- Lockfile from another OS
⚡ Quick fix
- Make it optionalDependencies
- Update npm
- Regenerate the lockfile on the target platform
Detailed fix by platform
npm
npm install --omit=optional # or move fsevents to optionalDependencies
How to diagnose
- Package — Which one and wanted platform?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026