This is a completely newbie question and I'm sure the solution is very easy but I don't get it.
I downloaded Node.js and put the command-tool file and the npm in my project file.
I created a file called example.js which contains
console.log("hello world"); Now I open the node file and type in
node example.js And it shows me unexpected Identifier.
Thanks in advance.
Edit:
node -v Shows node is not defined ?? .. I'm slightly confused.
Edit2: MAC IOS
Edit3: I installed it and the path was usr/local/bin am I allowed to just move the file?
Edit4: Thanks node -v works now. I opened it through the cmd tool
Edit5: okay now everything works.. I thought I have to work with the node cmd tool. Thanks for the quick help!
node -vsay? And which operating system do you have?node example.jsin a file (which is why you get unexpected indentifier),node example.jsshould be typed in your shell. Open a terminal and issue that command from the directory in which you have the file.node example.jsyou would get anunexpected identifiererror as it's not valid javascript, you have to open a command line window and typenode example.js?