831793785.jpg

Linux

node.js npm

 #Download wget  https://nodejs.org/dist/v14.15.3/node-v14.15.3-linux-x64.tar.xz #Decompress tar xf node-v14.15.3-linux-x64.tar.xz #Enter directory cd node-v14.15.3-linux-x64 #Establish soft connection and take effect globally ln -s /root/node-v14.15.3-linux-x64/bin/npm /usr/local/bin/npm ln -s /root/node-v14.15.3-linux-x64/bin/node /usr/local/bin/node Node - v # version query Npm - v # version query Which npm # where is npm npm installation directory

Soft link is created without configuring environment variables
vim /etc/profile
Add to bottom
export PATH=$PATH:/root/node-v14.15.3-linux-x64/bin

Refresh the configuration and take effect immediately
source /etc/profile
yarn

 #Installation npm install -g yarn #Create a soft link. It takes effect globally ln -s  /root/node-v14.15.3-linux-x64/bin/yarn /usr/local/bin/ #Version Query yarn -v #Installation position which yarn # whereis yarn

PM2

 #Install either. npm or yarn npm install -g pm2 yarn global add pm2 ##If you do not know where the installation location is, you can see the installation process #Create a soft link. It takes effect globally ln -s  /root/node-v14.15.3-linux-x64/bin/pm2 /usr/local/bin/ #Version Query pm2 -v #Installation position which pm2 # whereis pm2 #Start process pm2 start server.js #View process pm2 list

Windows

Node.js

Download on official website

Start installation and keep going next that will do

be careful: Check to install the necessary tools
Automatically install the necessary tools. Note that this will also install Chocolatey. The script will pop-up in a new window after the installation completes.

After installation CMD Window Execution

  1. node -v View node version
  2. npm -v View npm version
  3. npm install -g npm Npm update

If appears Not an internal or external command Check whether system variables are added. Generally, system variables are automatically added
Path: My Computer - Properties - Advanced System Settings - Environment Variables - System Variables - Path

Vue scaffold

Official website: Vue CLI

The global installation of vue cil, also known as scaffolding, is conditional on the installation of node.js
install

 npm install -g @vue/cli # or yarn global add @vue/cli
  • Question 1

If the command is executed: always stop at
fetchMetadata: sill resolveWithNewModule...

To view the node source:

 npm config get registry

Switch the source of Taobao

 npm config set registry  https://registry.npm.taobao.org
  • Question 2

Installation error

 npm WARN deprecated  vue-cli@2.9.6 : This package has been deprecated in favour of @vue/cli npm WARN deprecated  request@2.88.2 : request has been..... ... or other errors, see the reason

Try: clear the cache, uninstall and reinstall

 Clear Cache npm cache clean --force Uninstall older versions npm uninstall -g @vue/cli # or yarn global remove vue-cli

upgrade

 npm update -g @vue/cli # or yarn global upgrade --latest @vue/cli

View version

 vue -V # or vue --version

Installation succeeded. 'vue' is not an internal or external command?

System variables under configuration

 C:\***\node_global\

yarn

Download on official website

Node.js needs to be installed before installation

It's the same. Keep it up next that will do

After installation CMD Window execution

 npm install -g yarn

Verify whether the installation is successful

Re enter CMD view yarn edition

 yarn -v
End