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 run serve failed

Hi! I am getting this error when I run npm run serve... What I can do with that?

photoblog@ serve C:\Kasia\Angular2 first project\photo_blog webpack-dev-server --config config/develop.config.js --inline --progress --port 8080 70% 3/3 build modules events.js:160 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE 127.0.0.1:8080 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at Server._listen2 (net.js:1258:14) at listen (net.js:1294:10) at net.js:1404:9 at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)

npm ERR! Windows_NT 10.0.15063 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "serv e" npm ERR! node v6.11.1 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! photoblog@ serve: webpack-dev-server --config config/develop.config.js --inline --progress --port 8080 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the photoblog@ serve script 'webpack-dev-server --config config/develop.config.js --inline --progress --port 8080'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the photoblog package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack-dev-server --config config/develop.config.js --inline --progress --port 8080 npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs photoblog npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls photoblog npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Kasia\Angular2 first project\photo_blog\npm-debug.log

2 Answers

Seth Kroger
Seth Kroger
56,413 Points

You have another server running on the same port/address (The "EADDRINUSE 127.0.0.1:8080", is Error, Address In Use), and if you ran the same command before that server could very well still be running. If you go to localhost:8080 in your web browser does it show you that project you're working on or something else? Do you have other terminal windows/tabs open? (if you find something running use Ctrl+D to stop it) Try hunting down the process in Task Manager and end it. And, as a last resort, reboot.

I restarted my PC and it worked. I had open terminal in Visual Studio. I didn't have another terminal open.

Thanks for your answer :)