-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
What / Why
Executing npm ci ignores the os field in package.json. This causes platform specific packages like fsevents (macOS-only) to be installed on other platforms (Windows in this case).
When
- Every install through
npm ci
Where
- Packages with the
osfield specified in package.json
How
Current Behavior
- See description
Steps to Reproduce
- Run npm init in a new directory on a windows machine
- Install a package with a deeply nested optional dependency on fsevents, like webpack:
npm i webpack - Notice a package-lock.json is created with an optional dependency on
[email protected] - Remove
node_moduleste create a clean CI clone state - Run
npm ci - See the installation fail because
fseventsis downloaded, installed, and node-gyp is executed as a result.
Expected Behavior
fseventsis skipped as the package is unsupported on Windows.
Who
References
seangwright, jwiggers, jvanoostveen, madmox, gangstead and 4 more
Metadata
Metadata
Assignees
Labels
No labels