How to fix npm ERR! code ENOTSUP npm ERR! notsup Unsupported platform for package: wanted {"os":"linux"} (current: {"os":"win32"}) in npm

npmBEGINNERMEDIUMUpdated Dec 6, 2025· 198 views

The ENOTSUP platform error occurs when a package declares it only works on specific operating systems. Common examples include the 'n' version manager (Linux/macOS only) on Windows. Use platform-appropriate alternatives or WSL on Windows.

Quick fix

Fixes ENOTSUP

Unsupported platform for n@9.0.0: wanted {"os":"!win32"} (current: {"os":"win32"})
  1. Check the package's platform requirements
  2. Use platform-appropriate alternatives
  3. Use WSL for Unix-only packages
  4. Handle optional dependencies gracefully
npm — error
Unsupported platform for n@9.0.0: wanted {"os":"!win32"} (current: {"os":"win32"})
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported platform for package: wanted {"os":"linux"} (current: {"os":"win32"})

What this error means

This error occurs when you try to install a package that has declared itself incompatible with your operating system. Package maintainers can specify supported platforms in their package.json using the "os" field—and npm enforces these restrictions during installation. A classic example is the "n" Node.js version manager, which specifies `"os": "!win32"` (not Windows) because it relies on Unix shell scripts. When you try to install it on Windows, npm refuses with ENOTSUP. This is npm protecting you from installing software that won't work on your system, rather than letting you discover the incompatibility at runtime.

Typical symptoms

  • npm install fails with 'Unsupported platform' message
  • Error shows wanted OS vs current OS mismatch
  • Package explicitly lists !win32, !darwin, or !linux
  • Installing fsevents on Linux shows warnings (non-blocking)
  • All npm commands fail with ENOTSUP after Node.js upgrade
  • Package worked before but fails after system changes

Common causes

  1. Package explicitly declares incompatible OS in package.json
  2. Trying to install Unix-specific tools on Windows (e.g., 'n' version manager)
  3. Installing macOS-specific packages like fsevents on Linux
  4. Copying package-lock.json from a different OS
  5. Vagrant shared folders causing socket operation errors
  6. Antivirus software interfering with npm operations

How to fix "npm ERR! code ENOTSUP npm ERR! notsup Unsupported platform for package: wanted {"os":"linux"} (current: {"os":"win32"})"

1Check the package's platform requirements

Look at the error message to see what platform the package wants:

bash
Unsupported platform for n@9.0.0: wanted {"os":"!win32"} (current: {"os":"win32"})

The !win32 means "not Windows". Check the package's npm page or GitHub for platform-specific alternatives.

2Use platform-appropriate alternatives

Many packages have alternatives for different platforms:

| Package | Alternative for Windows |
|---------|------------------------|
| n | nvm-windows or fnm |
| fsevents | Not needed (macOS only) |
| unix-specific CLIs | WSL (Windows Subsystem for Linux) |

For example, instead of n, use nvm-windows:

powershell
# Install nvm-windows from https://github.com/coreybutler/nvm-windows
nvm install 20
nvm use 20
3Use WSL for Unix-only packages

Windows Subsystem for Linux lets you run Linux tools natively:

powershell
# Install WSL (PowerShell as Admin)
wsl --install

# Then in WSL terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 20

WSL provides a full Linux environment where most npm packages work without modification.

4Handle optional dependencies gracefully

Some packages like fsevents are optional and only needed on specific platforms. Warnings about them are usually safe to ignore:

bash
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2

These warnings don't prevent installation—they just indicate a platform-specific optimization won't be available.

5Force install (use with caution)

You can bypass platform checks, but the package likely won't work:

bash
npm install <package> --force

Warning: This installs the package but doesn't make it compatible. Only use this if you know the package will work despite the warning.

6Fix Vagrant and shared folder issues

If you're getting ENOTSUP in Vagrant with Node.js 18.18+:

1. Move your project out of Vagrant shared folders
2. Or run npm install on the host machine
3. Or downgrade to Node.js 18.17 or earlier

This is a known issue with Node.js socket operations on VirtualBox shared folders.

Advanced notes

Package maintainers declare platform support in their package.json:

json
{
  "os": ["darwin", "linux"],  // Only macOS and Linux
  "os": ["!win32"],           // Not Windows
  "cpu": ["x64", "arm64"]     // Specific architectures
}

If you're a package maintainer and want to support more platforms, consider:
- Using cross-platform Node.js APIs instead of platform-specific code
- Providing alternative implementations for different platforms
- Clearly documenting platform requirements

For CI/CD pipelines, ensure your build runners match your deployment target. If you deploy to Linux but build on macOS, platform-specific optional dependencies may differ.

The ENOTSUP error can also occur with socket operations on network-mounted filesystems. If npm commands fail with "operation not supported on socket" errors, try running npm from a local filesystem instead of network drives or mounted volumes.

Frequently asked questions

What does "ENOTSUP" mean?
This error occurs when you try to install a package that has declared itself incompatible with your operating system. json using the "os" field—and npm enforces these restrictions during installation. win32" (not Windows) because it relies on Unix shell scripts.
How do I fix "ENOTSUP"?
The ENOTSUP platform error occurs when a package declares it only works on specific operating systems. Common examples include the 'n' version manager (Linux/macOS only) on Windows. Use platform-appropriate alternatives or WSL on Windows.
What causes "ENOTSUP"?
Package explicitly declares incompatible OS in package.json Trying to install Unix-specific tools on Windows (e.g., 'n' version manager) Installing macOS-specific packages like fsevents on Linux
Is the "ENOTSUP" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading