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 npm Basics (retiring) Installing Packages with npm Installing Local Packages

Gabriel Ward
Gabriel Ward
20,222 Points

Installing bcrypt into folder on my desktop

I have python version 2.7 and npm installed on my computer. On my desktop I have a folder called Node. I've navigated to this folder in the command line, i.e cd Desktop\Node

Then I ran this command

npm install bcrypt

I got a massive long error. Does anyone have any advice on this?

3 Answers

Gabriel are you able to post the error here?

Gabriel Ward
Gabriel Ward
20,222 Points

C:\Users\Gabriel\Desktop\Node>npm install bcrypt python

bcrypt@0.8.5 install C:\Users\Gabriel\Desktop\Node\node_modules\bcrypt node-gyp rebuild

Hi Bryan,

It's a big long thing. I'm new to this stuff! I'd appreciate any help.

C:\Users\Gabriel\Desktop\Node\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio n number. [C:\Users\Gabriel\Desktop\Node\node_modules\bcrypt\build\bcrypt_lib.vcxproj] TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Gabriel\Deskt op\Node\node_modules\bcrypt\build\bcrypt_lib.vcxproj]

gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Windows_NT 10.0.10586 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" gyp ERR! cwd C:\Users\Gabriel\Desktop\Node\node_modules\bcrypt gyp ERR! node -v v4.3.1 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "bcrypt" "python" npm ERR! node v4.3.1 npm ERR! npm v2.14.12 npm ERR! code ELIFECYCLE

npm ERR! bcrypt@0.8.5 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the bcrypt package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls bcrypt npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Gabriel\Desktop\Node\npm-debug.log

What's your version of node?

jason chan
jason chan
31,009 Points

Try deleting C:\Users\Gabriel\Desktop\Node\node_modules

Then npm reinstall everything. Also try reinstalling node.exe.

This looks like a failed install/upgrade to me. You'll want to clear your cache:

npm cache clear && bower cache clean

Then remove your old directories:

rm -rf node_modules bower_components

then reinstall:

npm install && bower install

windows is weird. Worse case scenario install the packages on c9 and code with that. windows and mac sometimes are wonky with packages.

Gabriel Ward
Gabriel Ward
20,222 Points

Well, it looks like it's a thing particular to bcrypt, because I think I successfully installed 'express' into my folder.