You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Installing package that has a development dependency that in turn has platform-specific dependencies crashes because npm install selects the wrong platform.
With multiple dependencies to choose from, the one that is compatible with the operating system should be selected. It isn't, and the install fails with EBADPLATFORM.
Steps To Reproduce
On macOS 15.2 or Windows 11 running under Parallels on macOS:
Create and switch to a new directory.
Run npm init.
Accept all the defaults.
Run npm install @aidc-toolkit/dev.
Sob quietly as your development grinds to a halt.
% npm install @aidc-toolkit/dev
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @rollup/[email protected]: wanted {"os":"linux","cpu":"x64","libc":"glibc"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os: linux
npm error notsup Actual os: darwin
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: arm64
npm error notsup Valid libc: glibc
npm error notsup Actual libc: undefined
npm error A complete log of this run can be found in: /Users/kevindean/.npm/_logs/2024-12-31T13_14_19_280Z-debug-0.log
Environment
npm: 11.0
Node.js: v22.11.0
OS Name: macOS
System Model Name:
npm config:
; copy and paste output from `npm config ls` here
; node bin location = /Users/kevindean/.asdf/installs/nodejs/22.11.0/bin/node
; node version = v22.11.0
; npm local prefix = /Users/kevindean/Temp/npmtest
; npm version = 11.0.0
; cwd = /Users/kevindean/Temp/npmtest
; HOME = /Users/kevindean
; Run npm config ls -l to show all defaults.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Installing package that has a development dependency that in turn has platform-specific dependencies crashes because
npm install
selects the wrong platform.Expected Behavior
npm install <package>
should ignoredevDependencies
in the installed package. It doesn't. This is a well known and frustratingly old bug ([BUG] Dev dependency should not throw “unsupported platform” error when using --production flag on npm install #2921).EBADPLATFORM
.Steps To Reproduce
On macOS 15.2 or Windows 11 running under Parallels on macOS:
npm init
.npm install @aidc-toolkit/dev
.Environment
; copy and paste output from `npm config ls` here
; node bin location = /Users/kevindean/.asdf/installs/nodejs/22.11.0/bin/node
; node version = v22.11.0
; npm local prefix = /Users/kevindean/Temp/npmtest
; npm version = 11.0.0
; cwd = /Users/kevindean/Temp/npmtest
; HOME = /Users/kevindean
; Run
npm config ls -l
to show all defaults.The text was updated successfully, but these errors were encountered: