I installed Node.js on my Ubuntu machine. I typed node but it didn't work. I typed nodejs and it worked. When I asked for the version, node -v didn't work but nodejs --version worked, it gives me "v0.10.25."
I updated Node from https://davidwalsh.name/upgrade-nodejs by using the commands
sudo npm cache clean -f,
sudo npm install -g n, and
sudo n stable.
Still it's not working. What should I do?

I would suggest uninstall previous version and install your desired version from scratch.
To uninstall old version:
Run this command in your terminal:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
To install new version:
You can download both LTS and Beta version from the official site of node.js
But the best way would be using NVM. This would help you install and use multiple version of node on a single machine.
You can also use n. Which is similar to NVM but it's lightweight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With