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 ci ignores the os field of package.json #658

Closed
guidobouman opened this issue Jan 6, 2020 · 1 comment
Closed

[BUG] npm ci ignores the os field of package.json #658

guidobouman opened this issue Jan 6, 2020 · 1 comment

Comments

@guidobouman
Copy link

guidobouman commented Jan 6, 2020

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 os field specified in package.json

How

Current Behavior

  • See description

Steps to Reproduce

  1. Run npm init in a new directory on a windows machine
  2. Install a package with a deeply nested optional dependency on fsevents, like webpack: npm i webpack
  3. Notice a package-lock.json is created with an optional dependency on [email protected]
  4. Remove node_modules te create a clean CI clone state
  5. Run npm ci
  6. See the installation fail because fsevents is downloaded, installed, and node-gyp is executed as a result.

Expected Behavior

  • fsevents is skipped as the package is unsupported on Windows.

Who

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant