# npm ERR! code EBADPLATFORM — notsup Unsupported platform for fsevents: wanted {"os":"darwin"} (current: {"os":"linux"})

**Code:** `EBADPLATFORM` · **Category:** npm · **Seen on:** npm

A package restricted to certain OS/CPU was installed as a required (not optional) dependency on another platform.

## 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.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/ebadplatform-unsupported-platform)
