First time using node.js - "ReferenceError: node is not defined" First time using node.js - "ReferenceError: node is not defined" git git

First time using node.js - "ReferenceError: node is not defined"


It looks like you have entered the node REPL and then typed node -v

The good news is that this means node is working!

To check the version from here you can type process.version to get the node version. Alternatively type process.exit() to exit the node REPL and get back to bash (or equivalent terminal).

From here node -v should just output the node version.


Edit

First time using node.js

Although already answered, but just putting in my 2-cents,

Normally, the first time users would trip over it, so am posting some screen shots, and that OP wants to try node -v, so making it a bit easier to follow.

The Wrong !!

Win+S> Node // or you open it by some other way

then you try here 'node -v' , which throws error


The Correct !!

Here it should work as expected


or you can do ..

then you have to go with another command

Hope it helps someone.!


Instead of node.exe, try to run node from "Node.js command prompt".

First, you should install nodejs.msi from nodejs.org.

Once installation is completed, go to: Start > All Programs > Node.js > Node.js command prompt.

It worked for me.