question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wiki instructions for updating `npm`'s bundled copy of `node-gyp` need updating

See original GitHub issue

See this comment: https://github.com/nodejs/node-gyp/issues/2354#issuecomment-810429130

To restate the main changes needed:

  • The Windows instructions are incorrect, as they use the -g flag (meaning, to modify a standalone, global install of node-gyp), whereas the instructions are supposed to be telling you how to cd into the npm folder and locally update the copy/copies of node-gyp installed there. The use of the -g flag is inappropriate and leads to npm retaining its old/outdated copy of node-gyp.
  • Also, it seems to be necessary (in my testing) to upgrade node-gyp in two places, as multiple packages directly depend on node-gyp; not only npm itself, but the subdependency npm-lifecycle. One must cd into each package and upgrade its node-gyp dependency manually.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
cclausscommented, Jun 3, 2021

Thanks massively for your precision in fixing our docs.

1reaction
DeeDeeGcommented, Jun 2, 2021

Tested again reading/copy-pasting straight from the wiki page, and I can confirm it is working as written. Thank you very much!

Test scenarios:

  • Ubuntu 20.04, Node/npm installed with n, in a non-root-protected area (no sudo needed for this case)… Instructions work as written for npm 6 and 7, respectively ✔️
  • Windows 10, with one copy of Node/npm installed under the protected “Program Files” dir, another copy installed in a non-protected area by extracting a .zip archive… Instructions work as written for npm 6 and 7, respectively. ✔️

Idle thoughts (no action needed) regarding sudo or Administrator cmd.exe prompt: Users with Node installed in a non-protected area in Windows won’t need Administrator command prompt, just as Unix users don’t need sudo if their copy of Node is installed in a non root-owned/protected area. I think we explain this well enough in the Windows instructions, even if we don’t say so explicitly. I trust Linux users to figure it out. Using elevated permissions doesn’t hurt in this case, anyhow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-gyp - npm
node -gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. It contains a vendored copy of...
Read more >
How to updated node-gyp and/or interpret "node-gyp rebuild 2 ...
I resolved by updating the npm package. Try: npm install -g npm ... I received a (node-gyp rebuild 2> builderror.log) || (exit 0)...
Read more >
Changelog | Meteor API Docs
In case you want types in your app using the core packages ... The node-gyp npm package has been updated to version 6.0.1,...
Read more >
Packaging:Node.js - Fedora Project Wiki
The name of a Node.js extension/library package must start with nodejs- then the upstream name or name used in the npm registry. For...
Read more >
Node.js - ArchWiki
3.1 npm help does not display documentation; 3.2 node-gyp errors ... To display obsolete packages that may need to be updated: $ npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found