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 Home Route

Aleksandr Romanov
Aleksandr Romanov
1,226 Points

Error handling

When running the code on my local machine then the error occurs, saying: throw er; // Unhandled 'error' event. How to get rid of the mistake?

You need to post the code here. There is probably something wrong with your request. If you have just copied the working code from workspaces to your local machine then there could be problems with anything from permissions to your node installation.

2 Answers

Aleksandr Romanov
Aleksandr Romanov
1,226 Points

I was able to solve the problem, thanks! The actual problem was that I didn't kill the node server running, even though I pressed cmd+c , the process was still available in Task Manager.