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

Brian Patterson
Brian Patterson
19,588 Points

Has it installed or bcrypt or not.

I ran the following line in the console.

npm install bcrypt 

This is the result I got.

> bcrypt@1.0.3 install /Users/briankaty1/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/Users/briankaty1/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open '/Users/briankaty1/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/briankaty1/package.json'
npm WARN briankaty1 No description
npm WARN briankaty1 No repository field.
npm WARN briankaty1 No README data
npm WARN briankaty1 No license field.

+ bcrypt@1.0.3
added 111 packages in 8.783s

So is it installed? When I look in the folder there is nothing there!

2 Answers

Neil McPartlin
Neil McPartlin
14,662 Points

Hi Brian. From what I can see, the answer is 'yes you have installed it'. If you look inside the newly created node_modules folder (/Users/briankaty1/node_modules/) you will see the 110* modules, one of which is 'bcrypt'. (*Your result does report 111, as does mine, but there is probably a reason Windows reports 110 and not 111 entries inside the node_modules folder).

Another simple test is to type npm list bcrypt. After a short delay, it will report `-- bcrypt@1.0.3 which confirms to you that this module is installed locally on your computer.

Don't worry too much about those NPM warning messages. It is flagging the fact you currently have no package.json file and therefore it cannot read some of its contents.

Julianna Kahn
Julianna Kahn
20,702 Points

I had the same issue. Your test didn't work on bycript but it did work on bycriptjs - bcryptjs@2.4.3 So I guess I'm ok, thanks.