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 Node.js Basics 2017 Introduction to Node.js Hello World

why doesnt typing node app.js on any of my machines produce results any thing like Andrews even though I followed exact?

After launching workspaces and typing in node app.js the console will not execute app.js no matter how simple. It did give me the version number. when asked to execute app.js when it was empty like Andrew did. It gave me a long list of syntaxError Invalid or unexpected token. at a whole bunch of places. Did I not pay enough to be able to run code not through my brouser? Yes I cleared it and saved app.js many times on two machines.

1 Answer

William Wei Luan Ting
William Wei Luan Ting
4,254 Points

I believe you are trying to run node app.js inside of node. you should try to ^C or (Ctrl + C) twice to exit out of node then run node app.js to execute the file.