I am installing latest version of nodejs in my localhost. But system is always installing the 4.2.6 version.How can i install the latest version.
Commands i have use
In Linux/Mac systems, there is no better way than nvm - Node Version Manager.
Install:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Then, usage is as simple as:
nvm install 8.0
nvm use 8.0
If after reboot you will see old version, use nvm alias
to set your version as default one.