I am new to js and wanted to install nodejs LTS version and npm on ubuntu 21.10. So, I followed the nodesources repository install instructions and it had stated to use the install script for LTS and it worked fine as I followed the same instructions mentioned in it.
But, after installation of the nodejs package, when I try to check the node -v: it shows as 12.x.x, while the latest LTS version for nodejs is 16.x.x. I did not understand why this is happening and what is the solution for this?
P.S: I have mentioned the commands that I had used for installation of nodejs LTS 16.x.x, and the site link is this: https://github.com/nodesource/distributions/blob/master/README.md
Node.js LTS (v16.x): # Using Ubuntu curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs
Please note: I have not installed the optional build tools yet and not the npm as well. I'm confused on what to do now...