Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript npm Basics Installing Packages with npm Installing Local Packages

Ryan Doran
Ryan Doran
7,815 Points

bcrypt isn't downloaded

When I type npm install bcrypt into the console, this is the response. And bcrypt is not one of the folders under the NPM basics folder. There are many new folders, but not bcrypt. Also, it keeps shutting down the workspace.

> bcrypt@3.0.6 install /home/treehouse/workspace/node_mod
ules/bcrypt                                              
> node-pre-gyp install --fallback-to-build                                                          
node-pre-gyp WARN Using needle for node-pre-gyp https dow
nload                                                    
[bcrypt] Success: "/home/treehouse/workspace/node_modules
/bcrypt/lib/binding/bcrypt_lib.node" is installed via rem
ote                                                      
npm WARN saveError ENOENT: no such file or directory, ope
n '/home/treehouse/workspace/package.json'               
npm notice created a lockfile as package-lock.json. You s
hould commit this file. 
npm WARN enoent ENOENT: no such file or directory, open '
/home/treehouse/workspace/package.json'                  
npm WARN workspace No description                        
npm WARN workspace No repository field.                  
npm WARN workspace No README data                        
npm WARN workspace No license field.                     

+ bcrypt@3.0.6                                           
added 68 packages from 49 contributors and audited 97 pac
kages in 10.87s                                          
found 0 vulnerabilities

2 Answers

Did you see the teacher's notes?

Issues installing bcrypt?

If you are getting errors in the console while installing bcrypt, run npm install bcryptjs instead. Then require bcryptjs in app.js

Ryan Doran
Ryan Doran
7,815 Points

Thanks Kris, I read it a few times, I guess my brain ignored the 'js' portion.

still having issues

codingchewie
codingchewie
8,761 Points

Also note the preferred bcrypt is bcryptjs because it's just the JavaScript/module and doesn't require any additional settings or configuration. Reference: [Question] Difference between bcrypt and bcryptjs