1. NPM version upgrade

1. View the current version

node -v 
Copy the code

2. Run the following command to upgrade NPM to the latest version

npm install -g npm
Copy the code

3. To specify the version, run the following command

NPM install -g NPM @ Version number if upgraded to7.13. 0: NPM install -g np@7.13. 0
Copy the code

Node version management tool N

1. Use NPM to download n

NPM install -g n Sudo NPM install -g nCopy the code

2. Use n to download another node version. Otherwise, N cannot run and the node version cannot be switched

N node-version For example, n14.17. 0Sudo n14.17. 0
Copy the code

3. Run n

N You can view two versions of nodeCopy the code

3. Install YARN

1. Install commands

NPM install -g yarn No permission sudo NPM install -g yarnCopy the code

2. View the version number

yarn -v
Copy the code