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.

node-gyp version issue

See original GitHub issue

Thanks for this opportunity to report an issue! I have been using node-gyp on Mac and Windows, and am currently experiencing a problem in Windows. I have:

  1. Installed VS community 2017
  2. Installed VS Build tools 2017
  3. Installed NVM
  4. Ran nvm install 12.12.0 then nvm use 12.12.0
  5. Did a npm install –global windows-build-tools from administrator Powershell
  6. Did an npm config set msvs_version 2017
  7. Did an npm install –g node-gyp
  8. Did an npm install –g nw-gyp When I do an npm node-gyp -v , I get the version as 6.11.3 On doing an npm install in VSCode, I get the following within the terminal output:

gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\r.foss\AppData\Roaming\nvm\v12.12.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd D:\Git-Repos\ImmerGo-Demo\immergo-demo\node_modules\midi gyp ERR! node -v v12.12.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! This is a bug in node-gyp.

I can’t understand why the error is occurring, and also why the node-gyp version is indicated as 5.0.3 ? Any help would be much appreciated, thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
DeeDeeGcommented, Mar 30, 2021

Hmm, the instructions in the Wiki for Windows are a bit wrong. Those instructions use the -g flag when they shouldn’t.

To update npm’s copy of node-gyp, one should:

  • Go to [Your_node_dir]\node_modules\npm and
  • run npm install node-gyp
    • (This isn’t right: npm install -g node-gyp)

Also: npm-lifecycle has its own dependency on node-gyp that should be updated too:

  • Go to [Your_node_dir]\node_modules\npm\node_modules\npm-lifecycle and
  • run npm install node-gyp.

That is the version that actually gets run when doing an npm install, apparently.

(I suspect npm’s top-level dependency on node-gyp is just there to allow more direct and convenient control over the version of node-gyp that gets shipped with npm, for the npm maintainers. It seems a bit redundant, otherwise.)

0reactions
RichardFosscommented, Apr 1, 2021

Apologies for the slow reply - from my side, yes, it can be closed. Thanks for your help!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM install fails with node-gyp - Stack Overflow
If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable:.
Read more >
Solving common issues with node-gyp - LogRocket Blog
Solving common issues with node-gyp · node-gyp dependencies · Add-on compilation errors · Binding contract violation · Over 200k developers use ...
Read more >
node-gyp - npm
node -gyp requires that you have installed a compatible version of Python, one of: v3.7, v3.8, v3.9, or v3.10. If you have multiple...
Read more >
A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
A Comprehensive Guide to Fixing Node-Gyp Issues on Windows · 1. Try running npm install with the --no-optional flag. · 2. Try downloading...
Read more >
Troubleshooting node-gyp Package on Windows 11 | DevKimchi
NOTE: The default version of node-gyp is 8.2.0 , which comes with node.js (LTS) 14.13.0 , as the screenshot says. Python not found...
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