Blognpm

npm error EBADPLATFORM Unsupported platform How to fix it.

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

How the Agent API works
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"})
  • What it meansA package is for another operating system
  • The fixDelete the lock file, run npm install
  • ThenCommit the new package-lock.json
  • WhyThe lock file came from Windows or macOS

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.

01Questions

Platform questions, answered.

Anything else? Write to us and a person answers.

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.

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.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.