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] Starting with v10.4.0, --include=optional not working (for transitive dependency (sharp)) #7406
Comments
Further, tested on ubuntu as well, where cross-compilation continues to work on 10.5.0: Mac:
Ubuntu:
|
After some more digging over on lovell/sharp#4080 we found that on 10.4.0+ At this point I'm uncertain if this is a regression in npm, or intended behaviour. I looked at the release notes but couldn't immediately see a justification for the change. The behaviour may reside in https://github.com/npm/npm-install-checks |
This is one of those tricky situations where a bug was fixed and some folks may have been relying on the broken behavior. The fix was in arborist. The minified packument didn't include the npm is now currently behaving as intended. |
Thanks for clarifying @wraithgar 🙌 |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
We are deploying an app that uses the sharp image manipulation library. A deployment bundle is built on macs, with
npm i --cpu=x64 --os=linux --include=optional [email protected]
called afterwards to install cross-platform deps that can't be bundled, following which a tarball is created and used for deployments.On [email protected] and below, after running the above
npm i
commandnode_modules
contains dirs forsharp
and also the platform-specific transitive dependencies,@img/sharp-linux-x64
,@img/sharp-libvips-linux-x64
, etc.Starting with [email protected],
sharp
is installed but@img/...
is not, breaking our deployments.Expected Behavior
I believe the [email protected] behaviour is correct, the platform-specific transitive deps should be installed.
Steps To Reproduce
Latest node, [email protected] or 10.5.0
With this config: none needed
Run:
node_modules/@img
is an empty directory.Environment
The text was updated successfully, but these errors were encountered: