-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Labels
bugSomething isn't workingSomething isn't working
Description
🔧 Summary
When installing lefthook
using npm on Windows, the installation fails due to a platform-specific dependency (@css-inline/css-inline-linux-x64-gnu
). This does not happen when using pnpm, which correctly handles platform-specific optional dependencies.
Steps to reproduce
- On a Windows machine (OS: win32, CPU: x64)
- Initialize a Node project:
npm init -y
- Run:
npm install lefthook
This will fail with the following error:
Unsupported platform for @css-inline/[email protected]:
wanted {"os":"linux","cpu":"x64"} (current: {"os":"win32","cpu":"x64"})
Expected results
The installation should skip incompatible optional dependencies and complete successfully on Windows, similar to the behavior with pnpm
.
Actual results
Installation fails entirely when using npm
due to an unsupported platform error.
Possible Solution
- Either mark the dependency
@css-inline/css-inline-linux-x64-gnu
as optional or provide platform-specific variants (e.g.,@css-inline/css-inline-win32-x64-gnu
) depending on the current system. - Alternatively, adjust packaging so platform-specific binaries are only resolved during runtime, or provide fallback handling via JS if the native binary is missing.
Logs / Screenshots
$ npm install lefthook
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @css-inline/[email protected]: wanted {"os":"linux","cpu":"x64","libc":"glibc"} (current: {"os":"win32","cpu":"x64"})
npm error notsup Valid os: linux
npm error notsup Actual os: win32
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: x64
npm error notsup Valid libc: glibc
npm error notsup Actual libc: undefined
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working