[BUG] NPM v7.x does not skip OPTIONAL DEPENDENCY #2739
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 7.x
work is associated with a specific npm 7 release
Background:
I am an author of a golang project called sorvor and I wish to distribute golang binaries using NPM so that consumers do not have to install separate toolchain to get sorvor.
To achieve this, I've published prebuilt platform specific native binaries to NPM via below packages:
https://www.npmjs.com/package/sorvor-darwin-64
https://www.npmjs.com/package/sorvor-darwin-arm64
https://www.npmjs.com/package/sorvor-freebsd-64
https://www.npmjs.com/package/sorvor-freebsd-arm64
https://www.npmjs.com/package/sorvor-linux-32
https://www.npmjs.com/package/sorvor-linux-64
https://www.npmjs.com/package/sorvor-linux-arm
https://www.npmjs.com/package/sorvor-linux-arm64
https://www.npmjs.com/package/sorvor-windows-32
https://www.npmjs.com/package/sorvor-windows-64
I am expecting user's to have a single NPM dependency in their
package.json
for the main package:https://www.npmjs.com/package/sorvor
The main package lists all the native packages as optional dependencies so that and NPM can install appropriate optional dependency for a given platform.
Current Behavior:
NPM v7.x installs all optional dependencies without checking current OS and CPU arch.
Expected Behavior:
NPM v7.x should install optional dependencies only for current OS and CPU arch.
Note: This works correctly with NPM v6.x
Steps To Reproduce:
run
npm install --save-dev sorvor
Environment:
Related Issues:
#558
#475
The text was updated successfully, but these errors were encountered: