Error Knowledge Base npm EBADPLATFORM

npm ERR! code EBADPLATFORM

npm returned EBADPLATFORM because the package does not support the current operating system, CPU architecture, or runtime combination.

What Does Not Match This Runtime or Platform

npm returned EBADPLATFORM because the package does not support the current operating system, CPU architecture, or runtime combination.

Use a compatible runtime, platform, or published build

Use a package version that supports your current platform, or run the build on a supported OS and architecture.

If the failing dependency is optional, confirm your project can safely ignore it on this platform.

If the package must run here, follow its native-build instructions instead of treating this as a registry problem.

Why This Runtime or Platform Does Not Match

Usually this comes down to the package explicitly does not support your OS or CPU architecture, a native dependency only ships prebuilt binaries for some platforms, and the current one is not included, or an optional dependency became effectively required by your install or build process on an unsupported platform.

Prove the Runtime and Published Build Now Line Up

The reported process.platform and process.arch match a platform listed as supported by the package.

Re-run the original install on a supported platform, or after choosing a compatible version, and confirm EBADPLATFORM is gone.

Check runtime, platform, and index source

Print the current platform with node -p "process.platform + '/' + process.arch".

Inspect package constraints:npm view <pkg>@<version> os cpu optionalDependencies

If this is CI, confirm the runner architecture matches the one expected by the build or prebuilt binary.

Examples

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for package

How npm evaluates OS and CPU compatibility

Packages can declare supported os and cpu values, and native dependencies may only publish binaries for certain platforms. When the current machine does not match those constraints, npm skips optional packages or fails with EBADPLATFORM.

Prevent It From Coming Back

To prevent this, check OS and CPU support before adopting packages with native binaries, and keep CI runner architecture explicit so x64 and arm64 jobs do not drift unexpectedly.

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list