nodejs is already the newest version but "node -v" doesn't give a response

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