-
download
Download the version suitable for the operating system from the official website (URL: https://nodejs.org/en/download/ ). After testing, what needs to be downloaded here is ARMv8.
-
unzip
After the download is complete, find the location of the compressed package (you can also change the location by cutting), right-click to open the terminal, enter the
ls
command to view the compressed package name, and then use thetar
command to decompress. -
Rename
The name after decompression is relatively long, you can use the
mv
command to rename the folder. Here rename the unzipped folder to nodejs. As shown below: -
link
Establish a soft link to enable node and npm commands to be executed globally.
First enter the subfolder bin under the nodejs folder, then use the
pwd
command to print the current path, and then use theln -s
command to establish a soft link. Note that because it is a global establishment, it is necessary to usesudo
commands to enter root privileges. The specific commands are shown in the figure below: -
verification
Use
node -v
sumnpm -v
to check whether nodejs has become global.
Author: Yang Huihui