1//First, clear the npm cache:
2 npm cache clean -f
3
4//Install n, Node’s version manager:
5 npm install -g n
6
7//With the n module installed, you can use it to:
8 Install the latest stable version: n stable
9 Install the latest release: n latest
1//check node version
2>node -v
3// let's install a program called n that will let us easily switch
4//between Node versions.
5>npm install -g n
6//Upgrading to the latest stable version
7>n stable
8//Changing to a specific version
9>n 10.16.0
10
1In cmd,
2
3where node
4
5$ cd "C:\Program Files\nodejs\node_modules\npm"
6
7$ npm install -g node-gyp@latest