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 fails on npm install on Windows 11 latest build

See original GitHub issue

I’m using VS 2022 build tools and python 3.9, but the npm install seems to fail on node-gyp I also tried using VS 2019 and 2017 with no success

node version I’m using is 16.13.0 npm version is 8.14.0

Here is the log:

npm ERR! code 1 npm ERR! path C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\mixei\AppData\Local\Temp\install-583a6339.cmd npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.4.1 npm ERR! gyp info using node@16.13.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.9.0 found at “C:\Users\mixei\AppData\Local\Programs\Python\Python39\python.exe” npm ERR! gyp info find VS using VS2022 (17.2.32630.192) found at: npm ERR! gyp info find VS “C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools” npm ERR! gyp info find VS run with --verbose for detailed information npm ERR! gyp info spawn C:\Users\mixei\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args ‘C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\node-gyp\gyp\gyp_main.py’, npm ERR! gyp info spawn args ‘binding.gyp’, npm ERR! gyp info spawn args ‘-f’, npm ERR! gyp info spawn args ‘msvs’, npm ERR! gyp info spawn args ‘-I’, npm ERR! gyp info spawn args ‘C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate\build\config.gypi’, npm ERR! gyp info spawn args ‘-I’, npm ERR! gyp info spawn args ‘C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\node-gyp\addon.gypi’, npm ERR! gyp info spawn args ‘-I’, npm ERR! gyp info spawn args ‘C:\Users\mixei\AppData\Local\node-gyp\Cache\16.13.0\common.gypi’, npm ERR! gyp info spawn args ‘-Dlibrary=shared_library’, npm ERR! gyp info spawn args ‘-Dvisibility=default’, npm ERR! gyp info spawn args ‘-Dnode_root_dir=C:\Users\mixei\AppData\Local\node-gyp\Cache\16.13.0’, npm ERR! gyp info spawn args ‘-Dnode_gyp_dir=C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\node-gyp’, npm ERR! gyp info spawn args ‘-Dnode_lib_file=C:\\Users\\mixei\\AppData\\Local\\node-gyp\\Cache\\16.13.0\\<(target_arch)\\node.lib’, npm ERR! gyp info spawn args ‘-Dmodule_root_dir=C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate’, npm ERR! gyp info spawn args ‘-Dnode_engine=v8’, npm ERR! gyp info spawn args ‘–depth=.’, npm ERR! gyp info spawn args ‘–no-parallel’, npm ERR! gyp info spawn args ‘–generator-output’, npm ERR! gyp info spawn args ‘C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate\build’, npm ERR! gyp info spawn args ‘-Goutput_dir=.’ npm ERR! gyp info spawn args ] npm ERR! gyp: C:\Users\mixei\AppData\Local\node-gyp\Cache\16.13.0\common.gypi not found (cwd: C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate) while reading includes of binding.gyp while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\node-gyp\lib\configure.js:259:16) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) npm ERR! gyp ERR! System Windows_NT 10.0.22000 npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\node-gyp\bin\node-gyp.js” “rebuild” npm ERR! gyp ERR! cwd C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\utf-8-validate npm ERR! gyp ERR! node -v v16.13.0 npm ERR! gyp ERR! node-gyp -v v8.4.1 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\mixei\AppData\Local\npm-cache_logs\2022-07-14T10_39_57_847Z-debug-0.log

any ideas?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
richardlaucommented, Jul 14, 2022
npm ERR! gyp: C:\Users\mixei\AppData\Local\node-gyp\Cache\16.13.0\common.gypi not found
    (cwd: C:\Users\mixei\Desktop\Forbes Projects\garden\node_modules\fibers) while reading
    includes of binding.gyp while trying to load binding.gyp

Looks like the cached Node.js headers are missing a file or some sort of permissions problem? You could try removing the local cache and trying again:

node-gyp remove 16.13.0

FWIW even if you fix this problem fibers isn’t compatible with Node.js 16 https://www.npmjs.com/package/fibers.

1reaction
mabramishvilicommented, Jul 14, 2022

What exactly do you mean by following this link? @mabramishvili

I downloaded GTK bundle from https://ftp.gnome.org/pub/GNOME/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip

and unzipped the contents inside C:\GTK.

afterwards npm install worked without errors

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting node-gyp Package on Windows 11 | DevKimchi
Visual Studio 2019 Build Tools. Run the npm install command again. Then, you'll see the following error. Visual Studio not found error. The ......
Read more >
npm ERR! gyp ERR! when installing node sass in windows 11 ...
In my case I tried all the above: Downgrading node.js from version 16.13.2 to version 16.13.0 . Following this atricle. and it wasnt...
Read more >
A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
1. Try running npm install with the --no-optional flag. · 2. Try downloading the windows-build-tools package. · 3. Download the Visual Studio 2015 ......
Read more >
FIX - Windows NPM Node-gyp error for various NPM modules
If you've ever tried to install an NPM module like Xml2Js and received these pretty little errors followed by a failure to install...
Read more >
Set up Node.js on WSL 2 - Windows - Microsoft Learn
If you are using NVM to install Node.js and NPM, you should not need to use the SUDO command to install new packages....
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