node-gyp: node-gyp fails on npm install on Windows 11 latest build

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?

About this issue

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

Most upvoted comments

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.

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