Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm picks up wrong platform on npm install #8005

Open
2 tasks done
KDean-Dolphin opened this issue Dec 31, 2024 · 0 comments
Open
2 tasks done

[BUG] npm picks up wrong platform on npm install #8005

KDean-Dolphin opened this issue Dec 31, 2024 · 0 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@KDean-Dolphin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

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

  1. Running npm install <package> should ignore devDependencies 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).
  2. 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:

  1. Create and switch to a new directory.
  2. Run npm init.
  3. Accept all the defaults.
  4. Run npm install @aidc-toolkit/dev.
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

1 participant