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

Alexander Besse
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Besse
Full Stack JavaScript Techdegree Graduate 35,115 Points

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,314 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
Adam Beer
11,314 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!