JavaScript Node.js Basics Introduction to Node.js Hello World

Michael Slattery
PRO
Michael Slattery
Pro Student 3,273 Points

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.

William Wei Luan Ting
William Wei Luan Ting
2,580 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.