feat: include built package version in error logs#3254
Merged
lukekarrys merged 1 commit intonodejs:mainfrom Dec 19, 2025
Merged
feat: include built package version in error logs#3254lukekarrys merged 1 commit intonodejs:mainfrom
lukekarrys merged 1 commit intonodejs:mainfrom
Conversation
lukekarrys
approved these changes
Dec 16, 2025
I'm working on upgrading a lot of packages to node 24 and there are many failures in native modules. Looking at logs alone it's hard to spot which package versions are failing to build. node-gyp prints debug info about node, npm, and node-gyp but not the package that is currently being built. It doesn't look like node-gyp reads package.json so I opted to read npm_package_ env vars, which is similar to the npm_config_ env vars node-gyp already reads.
21c0ef2 to
76fc454
Compare
Member
|
I don't think this requires tests or documentation. @everett1992 were you able to test this change in your local env to see the output? |
Contributor
Author
|
I patched node-gyp in my node/npm install |
Member
|
Thanks @everett1992! |
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.
I'm working on upgrading a lot of packages to node 24 and there are many failures in native modules. Looking at logs alone it's hard to spot which package versions are failing to build. node-gyp prints debug info about node, npm, and node-gyp but not the package that is currently being built.
It doesn't look like node-gyp reads package.json so I opted to read npm_package_ env vars, which is similar to the npm_config_ env vars node-gyp already reads.
Checklist
npm install && npm run lint && npm testpassesI didn't write any tests, there's no tests that cover other error messages or even trigger an error.
Not sure what to document for this.
Description of change