You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opposite of --ensure, and is --ensure still useful? #1216
I was looking for a way to force node-gyp to re-download the headers even if the directory already exists in $npm_config_devdir/$node_version, and I found --ensure, which seems to do the opposite.
As I understand it, node-gyp doesn't download the headers unless the directory is missing, so --ensure is the default behaviour. Am I missing something? Is there a --always-redownload option (and should there be)?
Obviously as a workaround you can do this before the node-gyp rebuild or npm install:
node "$(npm config get prefix)"/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js remove $(node -p process.versions.node)
As I understand it, node-gyp doesn't download the headers unless the directory is missing, so --ensure is the default behaviour. Am I missing something?
That's correct. It's unconditionally set in lib/configure.js.
Is there a --always-redownload option (and should there be)?
I don't think so. What good would it do?
Thinking about this further, if the --tarball option is passed, I think it makes sense to delete the header directory and recreate it.
I suppose. It could piggyback on the remove command.
I ran into this because we were testing v8.0.0-pre, and node-gyp didn't re-download the headers, which meant that we got lots of this error when the NODE_MODULE_VERSION was updated:
module.js:598
return process.dlopen(module, path._makeLong(filename));
^
Error: The module '/space/jenkins-local/workspace/ibm-node8-appmetrics/ARCH/x64/CC/gcc48/OS/linux/label/build/node-v8.0.0-linux-x64/lib/node_modules/appmetrics/appmetrics.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 55. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
When running in CI I always want to redownload the headers.
If the "--tarball always reinstalls the headers" option is acceptable I'm happy with that.
Activity
[-]Opposite of --ensure still useful?[/-][+]Opposite of --ensure, and is --ensure still useful?[/+]gibfahn commentedon May 31, 2017
Thinking about this further, if the
--tarballoption is passed, I think it makes sense to delete the header directory and recreate it.Thoughts?
bnoordhuis commentedon Jun 2, 2017
That's correct. It's unconditionally set in lib/configure.js.
I don't think so. What good would it do?
I suppose. It could piggyback on the remove command.
gibfahn commentedon Jun 2, 2017
I ran into this because we were testing
v8.0.0-pre, andnode-gypdidn't re-download the headers, which meant that we got lots of this error when theNODE_MODULE_VERSIONwas updated:When running in CI I always want to redownload the headers.
If the "
--tarballalways reinstalls the headers" option is acceptable I'm happy with that.configure: don't set ensure if tarball is set
configure: don't set ensure if tarball is set