简体   繁体   中英

How to install version 12 of nodejs

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

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_12.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 12

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM