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

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,660 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,700 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.