Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript REST API Validation with Express The Importance of Data Validation Get Started with the Project

Jeffrey Holcomb
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jeffrey Holcomb
Full Stack JavaScript Techdegree Graduate 17,506 Points

Getting a lot of errors when running npm install

When running npm install, it gets to a certain point in the process where it causes a cascade of errors and I can't really tell what is going on. I've pasted the errors from the terminal below:

npm ERR! code 1
npm ERR! path C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt\lib\binding\napi-v3 --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.5
npm ERR! node-pre-gyp info using node@14.16.1 | win32 | ia32
npm ERR! node-pre-gyp info check checked for "C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-win32-ia32-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-win32-ia32-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for bcrypt@5.0.1 and node@14.16.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-win32-ia32-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.1 | win32 | ia32
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.16.1 | win32 | ia32
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\jeffh\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\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.7.30406.217) 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 - found VC++ toolset: v142
npm ERR! gyp ERR! find VS - missing any Windows SDK
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\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\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.19042
npm ERR! gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\jeffh\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\jeffh\\Documents\\Dev Stuff\\rest-api\\node_modules\\bcrypt\\lib\\binding\\napi-v3\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\jeffh\\Documents\\Dev Stuff\\rest-api\\node_modules\\bcrypt\\lib\\binding\\napi-v3" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt
npm ERR! gyp ERR! node -v v14.16.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\jeffh\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt\lib\binding\napi-v3 --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\jeffh\\Documents\\Dev Stuff\\rest-api\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\jeffh\Documents\Dev Stuff\rest-api\node_modules\bcrypt
npm ERR! node-pre-gyp ERR! node -v v14.16.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.5
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jeffh\AppData\Local\npm-cache\_logs\2021-09-21T00_55_49_910Z-debug.log
Blake Larson
Blake Larson
13,014 Points

Is this in VScode?


" 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

"


Maybe try updating your VScode (usually does it on it's own) and your Node.js to the current 16 version.

The initial message looks like bcrypt.

If you can't get it to run I would just manually install all the modules. That way you can figure out which one is throwing the error.

1 Answer

Tomas Schaffer
Tomas Schaffer
11,606 Points

Hi try to execute in cmd line this "npm install --g --production windows-build-tools" maybe it helps and after execute npm install