[Node version management tool n] nanny level tutorial

1. Install n

terminal run npm install n -gcommand

If you use npm install n -git directly to report an error, you must add one in front of it sudoto run with an administrator role.

Use after installation nor n --versionview

insert image description here

Two, common commands

Install or use a version: n node-version
e.g.sudo n 14,18.3

When using the command sudo n 14,18.3:
When sudo n 14,18.3the version is not installed, install this version.
If sudo n 14,18.3the version is already installed, switch the node version.

View all installed node versions:n

You can enter nthe command in the terminal to view all installed node versions.

In the version display interface, you can use the up and down arrows to select the node version you want to use, and then press Enter to select.
Press qor control + Cto exit the node version list:

Install the latest nodeversion: n latest
Install the latest stable version: n stable
Install the latest long-term maintenance version: n lts
Delete a version n rm <version>
Delete all other versions except the current version:n prune

Guess you like

Origin blog.csdn.net/Web_chicken/article/details/127888232