Skip to content
This repository has been archived by the owner on Aug 17, 2019. It is now read-only.

cipm ignores default value of package.json install script when binding.gyp is present #45

Closed
caleblloyd opened this issue Apr 7, 2018 · 0 comments

Comments

@caleblloyd
Copy link
Contributor

This was first opened upstream to npm at npm/npm#20275

It appears that the root cause of the upstream issue is that cipm is not considering the default value of the install script:

"install": "node-gyp rebuild":

If there is a binding.gyp file in the root of your package and you haven't defined your own install or preinstall scripts, npm will default the install command to compile using node-gyp.

Detection for the binding.gyp file should be run and pkg.scripts.install should be added to the pkg object before the install hook is called here:

cipm/index.js

Line 285 in 08ed1cc

.then(() => this.runScript('install', pkg, depPath))

@zkat zkat closed this as completed in 9149631 Apr 8, 2018
iarna added a commit to npm/npm that referenced this issue Apr 12, 2018
detect binding.gyp for default install lifecycle

PR-URL: zkat/cipm#46
Fixes: zkat/cipm#45
Credit: @caleblloyd
Reviewed-By: @zkat
iarna added a commit to npm/npm that referenced this issue Apr 12, 2018
detect binding.gyp for default install lifecycle

PR-URL: zkat/cipm#46
Fixes: zkat/cipm#45
Credit: @caleblloyd
Reviewed-By: @zkat
reyronald added a commit to reyronald/cipm that referenced this issue May 11, 2018
This is a continuation of zkat#45, a side-effect of the provided fix for it
in zkat#46 and was introduced in `cipm@1.6.2`.

For the case where a default `install` script is used and a
`binding.gyp` file is present in  the package root, `npm ci` will fail
with packages that target a different platform that the one currently
running.

Fixes zkat#49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant