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 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.