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 Managing Dependencies in the package.json File

fredyrosales
fredyrosales
10,572 Points

Need help getting Packages in Dependencies.

OK. First of all i'm using atom so i don't know how to share my Code. When i download Bcrypt and the colors Packages it goes to my file trees like it should. When i try to add to add it to my dependencies(package.json) it just doesn't update like it does for Andrew. I have uninstalled Node/NPM twice. I have tried npm i bcrypt --save and no luck. I have tried npm i bcrypt --save-dev also no luck. If anyone know how i can get these packages into my package.json i will be very grateful! other than that i'm fine. Also when i downloaded Mocha all hell broke loose in my Tree. A lot of folders that come with Mocha took over so i had to uninstall it. Please any thing that can get me a stepl closer to figuring this out i will be very grateful! Have a Blessed day! Here's what i get when i try to add it to dependencies... Fredys-MBP:node_modules FredySaaan$ npm i bcrypt --save-dev

bcrypt@0.8.7 install /Users/FredySaaan/node_modules/bcrypt node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but ac tive developer directory '/Library/Developer/CommandLineTools ' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but ac tive developer directory '/Library/Developer/CommandLineTools ' is a command line tools instance

CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o

CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o SOLINK_MODULE(target) Release/bcrypt_lib.node clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 hash_generator@0.0.1 /Users/FredySaaan ā””ā”€ā”€ bcrypt@0.8.7

npm WARN enoent ENOENT: no such file or directory, open '/Use rs/FredySaaan/node_modules/test/package.json'

1 Answer

Jesse Zelaya
Jesse Zelaya
13,598 Points

Check out this post. Seems like a similar issue to yours.

This problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools, when a full regular XCode was required (happens when CLT are installed after XCode) Solution:

  1. Install Xcode (get it from https://developer.apple.com/xcode/) if you don't have it yet,
  2. Point xcode-select to the Xcode Developer directory using the following command:

Note: Make sure your Xcode app directory is the same as in the address above; most notably, it'll be probably /Applications/Xcode-Beta.app/Contents/Developeror /Applications/Xcode-beta.app/Contents/Developer if you installed beta XCode release instead.