Conversation
This comment was marked as outdated.
This comment was marked as outdated.
6ba8b1d to
5e424eb
Compare
wraithgar
commented
Mar 5, 2025
| npm_config_node_gyp = env.npm_config_node_gyp | ||
| } else { | ||
| // default | ||
| npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') |
Member
Author
There was a problem hiding this comment.
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.
Member
Author
|
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 |
This was referenced Mar 5, 2025
reggi
approved these changes
Mar 6, 2025
Merged
wraithgar
pushed a commit
that referenced
this pull request
Mar 7, 2025
🤖 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows for a
nodeGypoption to be passed in to define where the node-gyp bin is to run.It also allows for the environment variable
npm_config_node_gypto already be set, and not override it if it is.This is an extension of #222
Closes: npm/cli#2839
Co-author: @legobeat