I had installed node and npm via : $sudo apt-get install npm
then I realised the node version was 4.2.6, which I could not run my code ( some function syntax errors/ type erros etc.)
So I set to uninstall nodejs:
sudo apt-get remove npm sudo apt-get purge nodejs sudo apt-get autoremove rm -r /usr/local/bin/npm rm -rf ~/.npm rm -rf /opt/local/bin/node rm -rf opt/local/include/node rm -rf /opt/local/lib/node_modules
Installing again with latest LTS, I am following install instructions from https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
My Question: After above install nodejs version is still 4.2.6, How can I get the latest version ? Or uninstall and clean the 4.2.6 ?