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!
cd
-command) node example.js
, press enter
You should not RUN node before typing node example.js
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.