Try
nodejs --version
(at least on my system the binary is called nodejs)
Answer from Sergey on askubuntu.comTry
nodejs --version
(at least on my system the binary is called nodejs)
you seriously do not want to use apt-get to install NodeJS on ubuntu.
ubuntu's way of packaging 3rd party software means that you will always get outdated versions unless you have very active maintainers or slow software dev cycles—both of which are not true for NodeJS and the NodeJS package maintainers. i just checked and it looks like apt-get install nodejs will give you a v0.6.19 install, which is from june 2012—as of september 2013, when NodeJS has already hit stable v0.10.18, with considerable internal changes.
one more reason you do not want to apt-get NodeJS is that the executable will be called nodejs, for the simple reason that in the vast global namespace that is a contemporary linux distro, node had already been assigned to a an unrelated software when NodeJS hit the scene.
you probably want to compile NodeJS yourself, or try out one of the binary packages they have for download on nodejs.org.
Open up the terminal and type node -v
To change your node version, I'd recommend installing nvm. Once installed, to switch versions it's as simple as
nvm use <version>
You can check your current NodeJS version by using command node -v. And changing your version can be done by using node version manager. The easiest way to do that is by running this $ npm install -g n now you can change your current NodeJS version using n (version) e.g. n 4.0.0.
node -v
npm install -g n
n 4.0.0