0

I'm following a tutorial to start with node making a simple hello world. Basically I installed node and execute this line to test if the instalation went well:

$ node -v

and node return to me:

$ node -v
  ^^^^
SyntaxError: Unexpected identifier

can anyone tell me what am I doing wrong? I've search this errors in a lot of sites, i think it is simple to resolve... I have already uninstall and install again.

Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
Johnson
  • 1,396
  • 6
  • 17
  • 36
  • Do you call `node -v` in you command line, or do you type this in the the interactive node shell. It looks like you launched node and typed it there. You could test it by writing `console.log('hello world')` instead of `node -v`. – t.niese Jan 24 '17 at 18:34
  • i simply install node and type: "$ node -v". I type now "console.log('hello world') and it works – Johnson Jan 24 '17 at 18:41
  • The you launched node directly. You have to write `node -v` in you console of the system you use. – t.niese Jan 24 '17 at 18:48
  • Yes, you are right. I lauched node directly. now i wrote 'node -v' in CMD, and it returned to me "v.6.9.4", so good! but i still can't use the program ;( – Johnson Jan 24 '17 at 18:58
  • I've tried to install something, and it returns to me: "Npm should be run outside of the node repl, in your normal shell." – Johnson Jan 24 '17 at 19:13
  • The error message says the same as I did for the `node -v`. Execute the `npm` in your the command line/shell of the system and not the interactive shell of node. A google search for that error would have shown you this [question](http://stackoverflow.com/questions/26568236/error-npm-should-be-run-outside-of-the-node-repl-in-your-normal-shell). You should show at least some effort in solving your problems. – t.niese Jan 25 '17 at 05:57
  • Or if you really do not want to open a system shell and stay in REPL, you can try `node -e 'console.log(process.versions.v8);'` as it is suggested [here](http://stackoverflow.com/questions/5356113) – TGrif Jan 26 '17 at 18:02

0 Answers0