Install the latest linux (any) version nodejs

First, use the command in a terminal uname -a view the system version

uname -a

 64-bit x86_64

Therefore, to install the corresponding 64-bit nodejs
Open nodejs Chinese net download found 64 files

 

 Click here to copy it after download link to download using wget

 wget https://npm.taobao.org/mirrors/node/v12.14.1/node-v12.14.1-linux-x64.tar.xz

Well, you can see already downloaded

 Download the compressed file is tar.xz use tar command to extract

tar -xvf node-v12.14.1-linux-x64.tar.xz

 Well decompression

 Copy extract the folder to a specified location

sudo mv ./node-v12.14.1-linux-x64 /usr/local/node

Use sudo, you might need to enter a password when finished entering the password Enter on line

Next, create a shortcut (soft links) for the node and npm

sudo ln -s /usr/local/node/bin/node /usr/bin/node
sudo ln -s /usr/local/node/bin/npm /usr/bin/npm

Use node -v view node version number

This installation is complete

Use cnpm operation
npm install -g cnpm --registry=https://registry.npm.taobao.org

sudo ln -s /usr/local/node/bin/cnpm /usr/bin/cnpm

So far nodejs installation has been completed and npm use cnpm

Here is the win10 subsystem to do ubuntu linux install demo versions of other steps are the same as used nodejs

Guess you like

Origin www.cnblogs.com/easth/p/linux_install_nodejs.html