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

NPM not working

I'm typing exactly what the instructor is saying, it's giving me install errors though. Help please! Thank you in advance.

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.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.2 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above .

npm ERR! A complete log of this run can be found in:
npm ERR! /home/treehouse/.npm/_logs/2018-10-27T04_30_18_272Z-debug.log

Adam Beer
Adam Beer
11,304 Points

I have checked the workspace and the npm is working fine to me. I don't understand. What would you like to install with npm?

2 Answers

Adam Beer,

Trying to install bcrypt, but I get a bunch of ERR messages.

Adam Beer
Adam Beer
11,304 Points

I remembered how I did it. Please just try this, npm install bcryptjs and modify your code:

var bcrypt = require('bcrypt');

to

var bcrypt = require('bcryptjs');

Hope this help!