'How can I fix "npm ERR! code1"

I was trying to check some opensource projects to learn. I did npm install on terminal to dowload packages but i am getting this error and couldn't understand what caused error. I was an old project at the beginning it gave me the error of old packages and suggested me to update them, i deleted the old package-lock.json file and from pacgake.json i updated the dependencies.

I used "npm outdated --depth=3" to see which packages were missing.

Package                Current  Wanted  Latest  Location  Depended by
angular                MISSING   1.8.3   1.8.3  -         PlainCAT
angular-animate        MISSING   1.8.3   1.8.3  -         PlainCAT
angular-block-ui       MISSING   0.2.2   0.2.2  -         PlainCAT
angular-confirm1       MISSING   1.1.0   1.1.0  -         PlainCAT 
angular-sanitize       MISSING   1.8.3   1.8.3  -         PlainCAT
angular-toastr         MISSING   1.7.0   2.1.1  -         PlainCAT
angular-ui-bootstrap   MISSING   2.5.6   2.5.6  -         PlainCAT
bluebird               MISSING   3.7.2   3.7.2  -         PlainCAT
bootstrap              MISSING   3.4.1   5.1.3  -         PlainCAT
electron-context-menu  MISSING   0.9.1   3.1.2  -         PlainCAT
electron-is-dev        MISSING   0.3.0   2.0.0  -         PlainCAT
electron-search-text   MISSING   0.3.0   0.3.0  -         PlainCAT
jquery                 MISSING   2.2.4   3.6.0  -         PlainCAT
jschardet              MISSING   1.6.0   3.0.0  -         PlainCAT
node-cache             MISSING   4.2.1   5.1.2  -         PlainCAT
node-storage           MISSING   0.0.7   0.0.9  -         PlainCAT
nodehun                MISSING  2.0.12   3.0.2  -         PlainCAT
sha1-file              MISSING   1.0.4   3.0.0  -         PlainCAT
underscore             MISSING  1.13.3  1.13.3  -         PlainCAT

After i updated versions on package.json i tried "npm install" again but i get the error again.

npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward. npm WARN deprecated [email protected]: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward. npm WARN deprecated [email protected]: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward. npm ERR! code 1 npm ERR! path C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\nodehun 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 [email protected] npm ERR! gyp info using [email protected] | win32 | x64 npm ERR! gyp info find Python using Python version 3.8.5 found at "C:\Users\bugra\anaconda3\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.31727.386) found at: npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features" npm ERR! gyp ERR! find VS - missing any VC++ toolset npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use 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\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio.js:121:47) npm ERR! gyp ERR! stack at C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio.js:74:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio.js:351:14) npm ERR! gyp ERR! stack at C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio.js:70:14 npm ERR! gyp ERR! stack at C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio.js:372:16 npm ERR! gyp ERR! stack at C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\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.22000 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\nodehun npm ERR! gyp ERR! node -v v16.14.2 npm ERR! gyp ERR! node-gyp -v v6.1.0 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\bugra\AppData\Local\npm-cache_logs\2022-04-27T17_33_39_922Z-debug-0.log



Solution 1:[1]

Have you tried installing Visual Studio as it states on the error message? And if installed, is it on the path?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryan M