EBADPLATFORM 📦 npm

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

  1. Make it optionalDependencies
  2. Update npm
  3. Regenerate the lockfile on the target platform

Detailed fix by platform

npm

  1. npm install --omit=optional # or move fsevents to optionalDependencies

How to diagnose

  1. Package — Which one and wanted platform?
  2. 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.