Local upgrade installed Node and npm version

MacLocal upgrade has been installed NodeJsand Npmthe latest version can be upgraded and updated with what way.

In fact, windosthe upgrade nodejsis also very simple, just at nodejsthe official website to download and install the latest msican be.

It is noteworthy that the need to install the original nodejsinstallation path to installation path can not be installed to a new path.

1. Node upgrade

step1: View the current native nodeversion

1
node -v

step2: Clear nodejsthecache

1
npm cache clean -f

step3: Installation nodeManagement Toolsn

This tool is designed to manage nodejsversions, you do not doubt the name of the tool, and his name is"n"

1
npm install -g n

step4: install a different versionnodejs

Large columns   upgrade Node and npm locally installed versions E> . 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11

n latest

// install stable version
n stable

// use a version of the installation or
n- 8.2 .0

// delete a version of
the n-RM 6.7 .0

step5: Again View nodeversion

1
node -v

2. Update npmto the latest version

1
altitude above sea level, install latest @ g

Guess you like

Origin www.cnblogs.com/lijianming180/p/12026657.html