-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: use nodeGyp option #230
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
6ba8b1d
to
5e424eb
Compare
npm_config_node_gyp = env.npm_config_node_gyp | ||
} else { | ||
// default | ||
npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we built a safeguard in here in case require.resolve
wasn't available we'd still need this to throw if this default was needed and failed, so it's effectively a NOP. If you need this code to work in an environment that doesn't have require.resolve
you can pass in the option or set the environment variable.
We also need to go dive into npm/cli#8129 and make sure that flatOptions make it here like we expect. ETA: that PR now has the fix that makes sure this package gets npm's node-gyp config. https://github.com/npm/cli/pull/8129/files#diff-80c79142b1459e30b4b4cd64826d26a15fe1e0be8459290ad45eb7371c47e69cR350 |
🤖 I have created a release *beep* *boop* --- ## [9.1.0](v9.0.2...v9.1.0) (2025-03-07) ### Features * [`21694f2`](21694f2) [#230](#230) use nodeGyp option (#230) (@wraithgar, @legobeat) ### Chores * [`fea1ba3`](fea1ba3) [#229](#229) bump @npmcli/template-oss from 4.23.4 to 4.23.5 (#229) (@dependabot[bot], @npm-cli-bot) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This allows for a
nodeGyp
option to be passed in to define where the node-gyp bin is to run.It also allows for the environment variable
npm_config_node_gyp
to already be set, and not override it if it is.This is an extension of #222
Closes: npm/cli#2839
Co-author: @legobeat