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

Can't install Bcrypt on Mac

sudo npm install bcrypt

Password:

bcrypt@0.8.5 install /Users/kolinkoehl/node_modules/bcrypt node-gyp rebuild

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 69 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/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 Darwin 15.3.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/kolinkoehl/node_modules/bcrypt gyp ERR! node -v v4.2.6 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm ERR! Darwin 15.3.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bcrypt" npm ERR! node v4.2.6 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! /Users/kolinkoehl/npm-debug.log Kolins-MacBook-Pro-2:~ kolinkoehl$

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Kolin,

If you're on a Mac, did you try using Homebrew instead of NPM?

Make sure your Homebrew is up-to-date -- Run > brew update

Then run > brew install bcrypt

Give that a go. :dizzy:

Hi Jason, do I need to install Homebrew or can I not use npm?

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Hey Fernando Boza

Homebrew is the goto Package Manager for Mac. Using Homebrew will also install need dependencies.

You can use npm if you want, just make sure you checkout the bcrypt docs for info and needed dependencies.

:dizzy:

Next time, for anyone searching this, do sudo xcodebuild -license and agree to the terms of xcode. The reason why that happened above is because the OP recently updated his XCode and did not agree to the new terms. It happened to me as well :)

Thank you!