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 Build a Simple Dynamic Site with Node.js Handling Routes in Node.js Populating User Information

Jennifer Hughes
Jennifer Hughes
11,421 Points

Error: listen EADDRINUSE

Despite having CTR C twice, I am still getting the error:

Error: listen EADDRINUSE.

I tried using a different port in the workspace, but then the page will not load - "Workspace Unavailable. This is a preview link for a Treehouse Workspace that is not currently active.If you are the workspace owner, you can launch it again via the Treehouse site."

Other suggestions?

1 Answer

Is it possible you have the same workspace open in two windows, and in one of those you have node app.js already running?

I did just that and got this error message:

Server running at http://<workspace-url>/                                                                        

events.js:72                                                                                                     
        throw er; // Unhandled 'error' event                                                                     
              ^                                                                                                  
Error: listen EADDRINUSE                                                                                         
    at errnoException (net.js:904:11)