# npm error EBADPLATFORM Unsupported platform How to fix it.

URL: https://antideploy.com/blog/npm-error-ebadplatform-unsupported-platform

Your lock file was written on a different operating system and recorded a package that does not install on Linux. Regenerate it.

**What you see**

```
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @rollup/rollup-win32-x64-msvc@4.20.0:
npm error notsup wanted {"os":"win32","cpu":"x64"} (current: {"os":"linux","cpu":"x64"})
```

## At a glance

- **What it means**: A package is for another operating system
- **The fix**: Delete the lock file, run npm install
- **Then**: Commit the new package-lock.json
- **Why**: The lock file came from Windows or macOS

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## What it means

Some packages ship a different build for each operating system. The name in the message ends with the system it is for, such as `win32`. Your lock file lists that Windows build as required, but the build server runs Linux. The package installs on the machine that wrote the lock file and nowhere else.

## How to fix it

### 1. Delete package-lock.json

Remove only the lock file. Keep `package.json`.

### 2. Run npm install again

npm writes a fresh lock file. Optional packages for other systems are recorded as optional, so they do not break a Linux install.

### 3. Commit the new lock file

Commit it and deploy again. A failed deploy never counts against your plan.

## Why it happens

The lock file was written on a different machine, often a Windows or macOS laptop, or npm recorded an optional dependency as if it were required. Coding agents that run on Windows make this easy to hit.

## Platform questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Will this happen again?

Not once the lock file is rewritten by npm on your machine, because npm then marks other systems' packages as optional.

### Do I need to change my code?

No. Only the lock file is wrong.

### Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [npm ci can only install packages when your package.json and package-lock.json are in sync](https://antideploy.com/blog/npm-ci-can-only-install-packages-when-package-json-and-package-lock-json-are-in-sync): The lock file does not match package.json. Run npm install and commit the lock file.
- [npm error ERESOLVE could not resolve dependency tree](https://antideploy.com/blog/npm-err-eresolve-unable-to-resolve-dependency-tree): Two packages want different versions of a third. Align the versions, or use legacy-peer-deps.
- [Why does my app work on localhost but not online?](https://antideploy.com/blog/why-does-my-app-work-on-localhost-but-not-online): Nine common reasons, how to check each one, and how to fix it.

- [Deployments](https://antideploy.com/platform/deployments)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)

Facts on this page were checked against the live platform on 7 October 2026.

## Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
