Open koterpillar opened 2 years ago
Please note this is not a bug in npm 6. It was only used to produce the example package, but I expect npm 8 to be able to install older packages from the registry regardless.
I believe the meta.loadedFromDisk
check is causing the bug here: https://github.com/npm/cli/blob/e5761b9adafe8607ad68baa9599ad4eb228bc6be/workspaces/arborist/lib/arborist/rebuild.js#L257
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When:
B's custom install script does not run, instead it is replaced with
node-gyp rebuild
.Example:
@freekii/layerone-keytar@1.0.10
has been built and uploaded using npm 6npm-shrinkwrap.json
with"lockfileVersion": 1
keytar
as a dependencykeytar
hasprebuild-install || npm run build
When installing
@freekii/layerone-keytar@1.0.10
,keytar
's install script will not run, falling back tonode-gyp rebuild
. If the machine has no Python and required system libraries, that will fail whereas theprebuild-install
would have succeeded.Expected Behavior
Dependencies' install scripts should run as specified in their
package.json
.(Using example above) Installing
@freekii/layerone-keytar@1.0.10
runskeytar
'sprebuild-install
.Steps To Reproduce
keytar
(or use existing@freekii/layerone-keytar@1.0.10
and skip to sten 4).npm shrinkwrap
.node:16
Docker container), install the above package from npm.Environment