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 User Authentication With Express and Mongo User Registration Using Nodemon While Developing an Express App

I am getting an unhandled error when starting the app and my register route does not work.

events.js:174 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as _listen2] (net.js:1279:14) at listenInCluster (net.js:1327:12) at Server.listen (net.js:1414:7) at Function.listen (D:\Documents data drive\Full stack javascript\JavaScript-user-auth-express (1)\JavaScript-user-auth-express\S2V1\node_modules\express\lib\application.js:618:24) at Object.<anonymous> (D:\Documents data drive\Full stack javascript\JavaScript-user-auth-express (1)\JavaScript-user-auth-express\S2V1\app.js:38:5) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) Emitted 'error' event at: at emitErrorNT (net.js:1306:8) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:832:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) 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\ASUS\AppData\Roaming\npm-cache_logs\2019-07-24T06_48_05_237Z-debug.log

1 Answer

ok you need to edit package.json and add after author "main": "app.js" ,

and your project will work