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

Matthew Turner
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Matthew Turner
Full Stack JavaScript Techdegree Graduate 16,968 Points

Already read through all of the questions and tried everything. No help whatsoever. Please help.

Below is the code that I pasted in to the app.js file

var unsecurePlainTextPassword = "password"; var bcrypt = require('bcryptjs');

bcrypt.genSalt(10, function(err, salt) { bcrypt.hash(unsecurePlainTextPassword, salt, function(err, hash) { console.log(hash); }); });

This is what the console spits out.

treehouse:~/workspace$ node app.js
module.js:550
throw err;
^

Error: Cannot find module '/home/treehouse/workspace/app.js'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3

Why hasn't this course been updated. This is so frustrating. Please help as I am stuck here and unable to learn anything from this.

1 Answer

Hi,

where is your app.js file located? And could you provide a snapshot of your workspace?

Regards Magnus