node-gyp: Windows: cannot install npm and error show gyp error on node-gyp@5.1.1

I install npm in terminal problem is here

npm ERR! path D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\bcrypto
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@5.1.1
npm ERR! gyp info using node@14.15.4 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Users\PC\AppData\Local\Programs\Python\Python310\python.exe"        
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:315:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\useful Laravel files\\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\\BitGoJS\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\useful Laravel files\codecanyon-22764015-cryptex-ultimate-peer-to-peer-cryptocurrency-exchange-platform-with-selfhosted-wallets\BitGoJS\node_modules\bcrypto
npm ERR! gyp ERR! node -v v14.15.4
npm ERR! gyp ERR! node-gyp -v v5.1.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\PC\AppData\Local\npm-cache\_logs\2022-04-11T11_17_51_257Z-debug.log

why this happen. v14.15.4 is node version

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 42 (10 by maintainers)

Most upvoted comments

Removing node-sass and installing sass solved this for me

npm uninstall node-sass
npm i sass --save

解决了吗 这个问题卡我很久了

Removing node-sass and installing sass solved this for me

npm uninstall node-sass
npm i sass --save

This worked for me. Thanks 😃

Plus upgrade from node-gyp v3.8.0 to v9.3.0.

https://github.com/nodejs/node-gyp/tree/master/docs

The relevant methods in the docs have been tried, and Node.js has been installed to the latest version(node v16.14.2 npm v8.7.0), but it is still not work

npm ERR! code 1 npm ERR! path C:\Users\39071\AppData\Roaming\npm\node_modules\vsce\node_modules\keytar npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.14.2 | win32 | x64 npm ERR! gyp info find Python using Python version 3.10.4 found at “C:\Users\39071\AppData\Local\Programs\Python\Python310\python.exe” npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with ‘–loglevel silly’ for more details npm ERR! gyp ERR! find VS looking for Visual Studio 2015 npm ERR! gyp ERR! find VS - not found npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm ERR! gyp ERR! find VS including the “Desktop development with C++” workload. npm ERR! gyp ERR! find VS For more information consult the documentation at: npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows npm ERR! gyp ERR! find VS ************************************************************** npm ERR! gyp ERR! find VS npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14) npm ERR! gyp ERR! stack at C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14 npm ERR! gyp ERR! stack at C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16 npm ERR! gyp ERR! stack at C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:406:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:526:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16) npm ERR! gyp ERR! System Windows_NT 10.0.19044 npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\39071\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” npm ERR! gyp ERR! cwd C:\Users\39071\AppData\Roaming\npm\node_modules\vsce\node_modules\keytar npm ERR! gyp ERR! node -v v16.14.2 npm ERR! gyp ERR! node-gyp -v v9.0.0 npm ERR! gyp ERR! not ok

have made all the suggestion and still have the same error. Anybody knows?

npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.1 | win32 | x64 npm ERR! gyp info find Python using Python version 3.10.4 found at “C:\Users\Muddasir\AppData\Local\Programs\Python\Python310\python.exe” npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS checking VS2019 (16.11.32228.343) found at: npm ERR! gyp ERR! find VS “C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional” npm ERR! gyp ERR! find VS - found “Visual Studio C++ core features” npm ERR! gyp ERR! find VS - missing any VC++ toolset

Removing node-sass and installing sass solved this for me

npm uninstall node-sass
npm i sass --save

Resolved by just removing node-sass. My colleagues and I have saved countless hours with this solution.

I running node version 18 got same problem but then i downgrade to node version 14 then run again npm install and problem solved.

Here my details version

PHP: V 7.* Laravel: V 7.* NodeJS: V14.12.0 NPM: V6.14.8 Composer: V2.0.13

gyp info using node-gyp@4.0.0

The current version is v9.1.0 https://github.com/nodejs/node-gyp/releases Please upgrade.

@cclauss okay i reached the force of using node-gyp in Version 9.0.0 after i added this explicitly as dev-dependency in my package.json: “node-gyp”: “^9.0.0”, “conventional-changelog-conventionalcommits”: “^4.6.3”, “lerna”: “^4.0.0”, “prettier”: “^2.6.2”

following setup is currently installed:

  • OS Windows 10 (Build 19044.1766)
  • Python version 3.10.5
  • NodeJS Version 14.17.0
  • npm version 8.13.2
  • node-gyp Version 9.0.0
  • Visual Studio Community 2022
  • Visual Studio Build-Tools 2022

but when I am running “npm install” oder “yarn install” with the listed package.json I also get the same error:

_gyp info it worked if it ends with ok gyp info using node-gyp@9.0.0 gyp info using node@14.17.0 | win32 | ia32 gyp info find Python using Python version 3.10.5 found at “C:\Users\xxx\AppData\Local\Programs\Python\Python310\python.exe” gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS running in VS Command Prompt, installation path is: gyp ERR! find VS “C:\Program Files (x86)\Microsoft Visual Studio\2022” gyp ERR! find VS - will only use this version gyp ERR! find VS checking VS2022 (17.2.32616.157) found at: gyp ERR! find VS “C:\Program Files\Microsoft Visual Studio\2022\Community” gyp ERR! find VS - found “Visual Studio C++ core features” gyp ERR! find VS - found VC++ toolset: v143 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS checking VS2022 (17.2.32616.157) found at: gyp ERR! find VS “C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools” gyp ERR! find VS - found “Visual Studio C++ core features” gyp ERR! find VS - found VC++ toolset: v143 gyp ERR! find VS - found Windows SDK: 10.0.19041.0 gyp ERR! find VS - does not match this Visual Studio Command Prompt gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS ************************************************************** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the “Desktop development with C++” workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ************************************************************** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\find-visualstudio.js:122:47) gyp ERR! stack at C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\find-visualstudio.js:75:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\find-visualstudio.js:363:14) gyp ERR! stack at C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\find-visualstudio.js:71:14 gyp ERR! stack at C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\find-visualstudio.js:384:16 gyp ERR! stack at C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5) gyp ERR! stack at ChildProcess.emit (events.js:376:20) gyp ERR! stack at maybeClose (internal/child_process.js:1055:16) gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/child_process.js:288:5) gyp ERR! System Windows_NT 10.0.19044 gyp ERR! command “C:\Program Files (x86)\nodejs\node.exe” “C:\Users\xxx\WebstormProjects\projectname\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd C:\Users\xxx\WebstormProjects\projectname\node_modules\lmdb

I already did nearly every confiugration tips (set all Path variables, “npm config set msvs_version 2022 --global”, …) I am totaly confused because I did not get running my project since 3 days…