-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
node-gyp always pulls headers from internet #1133
Comments
IIRC |
You can pass https://docs.npmjs.com/cli/install
|
What @richardlau said. npm passes on any switches it doesn't consume itself to node-gyp. |
Seeing this in a firewalled build:
I can confirm that this works to prevent node-gyp from trying to download the headers:
Now:
So it's one step forward, one missing requirement in the npm offline cache back. :) |
This should not be closed. The A proper solution would be to fix node-gyp with an configurable URL in the
The node-gyp could have something like this, to avoid going out on the Internet to retrieve the node headers. |
@DJViking You can use |
|
Thank you, this fixed a sporadic issue I've been having for years now. Is this documented anywhere? |
Does not appear to be in https://docs.npmjs.com/cli/v10/using-npm/config (or v8 or v9 either) so 🤷 See also #2800 ... seems this support might have been removed in 9.3 But #1154 (comment) suggests that |
|
why not just put headers into npm package |
Why not put the header inside the official docker images? |
After tracing through the code, I noticed that no matter what unless the --tarball flag is explicitly stated node-gyp will always attempt to pull the headers from the internet. The problem with this workaround is that if you try to install an existing npm module built with node-gyp, there is no means to specifying this flag.
It looks like fixing this would be as simple as adding a check if the file already exists in ~/.node-gyp for the architecture, or supporting an environment variable that specifies the path rather than a flag:
https://github.com/nodejs/node-gyp/blob/f6eab1f9e4b160b60b2736bb01a09c83785ba979/lib/install.js
The text was updated successfully, but these errors were encountered: