This is really confusing me. If I type "node -v" into the command line, there is no response - it just gives me the $
prompt again. Trying to install node with sudo npm install nodejs
gives the response nodejs is already the newest version
.
How can I debug this to find out what's going on?
nodejs -v
solved the problem.
In some linux distributions node executable is mapped into nodejs
.
Are you trying to print the node version? If yes then try
$ node --version
Node is by default installed on /usr/bin/ directory on linux OS it means it should run with normal user privilege but node include some tools that required Superuser privilege so ...
Instead running
node -v
run
sudo node -v
hope it will work...keep coding