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 User Authentication With Express and Mongo What is Authentication? Setting Up the Project

Harshay Raipancholi
seal-mask
.a{fill-rule:evenodd;}techdegree
Harshay Raipancholi
Python Development Techdegree Student 11,521 Points

NPM Start Doesn't Work

Hello Team,

when I run NPM Start I get the following error message, can you help :

C:\Users\harsh\Documents\Full Stack Javascript\auth project\JavaScript-user-auth-express\JavaScript-user-auth-express\complete>npm start

treehouse-express-auth@1.0.0 start C:\Users\harsh\Documents\Full Stack Javascript\auth project\JavaScript-user-auth-express\JavaScript-user-auth-express\complete node ./app

module.js:550 throw err; ^

Error: Cannot find module 'bcrypt' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\harsh\Documents\Full Stack Javascript\auth project\JavaScript-user-auth-express\JavaScript-user-auth-express\complete\models\user.js:2:14) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\harsh\Documents\Full Stack Javascript\auth project\JavaScript-user-auth-express\JavaScript-user-auth-express\complete\routes\index.js:3:12) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\harsh\Documents\Full Stack Javascript\auth project\JavaScript-user-auth-express\JavaScript-user-auth-express\complete\app.js:42:14) at Module._compile (module.js:653:30) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! treehouse-express-auth@1.0.0 start: node ./app npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the treehouse-express-auth@1.0.0 start 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! C:\Users\harsh\AppData\Roaming\npm-cache_logs\2018-10-06T08_30_05_549Z-debug.log

1 Answer

Zack Jackson
Zack Jackson
30,220 Points

Did you run npm install in your project directory? Check your package.json file to make sure bcrypt is listed as a dependency first. The error suggests that bcrypt is not in your node_modules folder.