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
-
Delete
package-lock.jsonRemove only the lock file. Keep
package.json. -
Run
npm installagainnpm writes a fresh lock file. Optional packages for other systems are recorded as optional, so they do not break a Linux install.
-
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.