Issue
i am trying to install version 12 of nodejs with command curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash but still getting version 8 of nodejs and also npm is not installed
Solution
the complete instructions for installing node from that distribution is two commands:
# install the source list, let apt-get install 'find' the nodejs package
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# apt-get now knows about nodejs package
sudo apt-get install -y nodejs
you'll find that when you follow these instructions, the script will print how to install yarn, and you should do that, also several commands (for adding sources, keys, and then installing the packages from those lists).
Suggested method
I would suggest using the n
library, because it doesn't require any OS modification, like so:
sudo npm i -g n
sudo n 20
Answered By - Dave Ankin Answer Checked By - Mary Flores (WPSolving Volunteer)