Sorry Linux n00b here.
I'm trying to update nodejs in a fresh installation of Ubuntu 22.04 in a VM.
When I run this:
nodejs --version
It outputs:
v12.22.9
I've seen in many places that to update node to the latest version you execute these commands:
sudo npm cache clean -fsudo npm install -g nsudo n stable
When I do it it appears to work and states:
copying: node/16.16.0
However, when I nodejs --version
again it still says v12.22.9
What am I doing wrong?
All I've found online tells me to do the above.
How can I update nodejs and have it say the latest version?