2

I was trying to run npm i --save-dev parcel and got this error below. I also tried to install it globally but it seems like not ok as npm list --depth=0 -g show only parcel@ but doesn't shows the version of parcel.

node: v18.0.0
npm: 8.6.0
os: windows 11
npm ERR! code 1
npm ERR! path D:\videos\projects\p6 forkify\node_modules\lmdb
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp-build
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@18.0.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Users\Tahazzot\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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modulenpm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1090:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22000npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\videos\projects\p6 forkify\node_modules\lmdb
npm ERR! gyp ERR! node -v v18.0.0npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:npm ERR!     C:\Users\Tahazzot\AppData\Local\npm-cache\_logs\2022-04-25T06_20_45_374Z-debug-0.log
Tahazzot
  • 1,224
  • 6
  • 27
  • Which part of the error is not clear to you? I mean it is telling you what is wrong and how to fix it. There's even link with more information. – Molda Apr 25 '22 at 06:42
  • I don't understand what's the connection of Visual studio or desktop dev with c++ with this npm pacel? It doesn't make any sense to me. Installing whole Desktop dev with C++ just for this npm parcel doesn't seems to be a solution for me. Everything is installing just fine expect this parcel, weird. – Tahazzot Apr 25 '22 at 06:54
  • There are certain tools required by node-gyp in order to build some libraries from source. The link provided explains where to get "Visual Studio build tools" NOT "whole Desktop dev". Without the BuildTools node-gyp won't be able to build any library for you. – Molda Apr 25 '22 at 08:16
  • I new here, can you please help me, how can I install build tools? https://github.com/nodejs/node-gyp#on-windows here I don't understand the first step. How to install it. After clicking the link it downloads the visual studio installer. then what? – Tahazzot Apr 25 '22 at 08:36
  • Click the link to download Visual Studio Build Tools, once it's downloaded then run it (double-click the file) – Molda Apr 25 '22 at 09:04
  • Thanks, I know it. But then which components or tool I have to install? There are lot? Which individual tools/ components should I install? – Tahazzot Apr 25 '22 at 14:54
  • Its possible that you're hitting the same problem as [this question](https://stackoverflow.com/a/69959236/4739687). The reason why C++ is relevant is because some parts of parcel are written in native code (not JS) for performance reasons. Because native code is platform-specific, sometimes node will do the compilation on-the-fly as the packages are installed - and I guess sometimes it barfs because the tools necessary to compile are not present. – Andrew Stegmaier Apr 25 '22 at 15:05
  • @Tahazzot i haven't used this since i'm on mac so hard to tell. But there should be on option Workload where you should choose Visual C++ build tools – Molda Apr 25 '22 at 16:06

0 Answers0