Node.js tutorial to install the Linux system

  • Use the command: the uname -a        inspection system is 32-bit or 64-bit

  • Official website: https://nodejs.org/en/download/  download the installation package
     

  • Server and upload files into the directory corresponding to decompress

tar -xvf node-v12.13.1-linux-x64.tar.xz
  • You can rename according to their preferences: 

mv node-v12.13.1-linux-x64/ nodejs-v12
  • Currently nodejs not a global view, so you want to configure to the global environment variable, establishing a soft connection:

ln -s /usr/local/nodejs-v12/bin/node /usr/local/bin/
ln -s /usr/local/nodejs-v12/bin/npm /usr/local/bin/
  • It can be in any directory, execute the command to view the installed version

node -v 
npm -v

  • Under the following to test whether the installation is successful, enter the command: the Node

  • Then execute the following command:

console.info("hello world");
  •  If the output result shown below, it indicates successful installation configuration node

  •  Enter the command: Node , if the result output as shown below, then also correctly installed npm

Published 12 original articles · won praise 4 · Views 2054

Guess you like

Origin blog.csdn.net/ba_qi/article/details/103177812