Node version management tool n package use tutorial explanation

1. Installing the N-management package

NPM INSTALL-GN command global installation,

After the installation is successful Terminal input

n –version or n

~ NPM INSTALL-GN / USR / local / bin / n -> / usr / local / lib / node_modules / n / bin / n + n@2.1.12updated 1 Package in 3.55s ~ n –version2.1.12 ~ nmkdir: / usr / local / n / Versions / Node: Permission Deniedmkdir: / usr / local / n / Versions / IO: Permission DeniedFind: / usr / local / N / Versions : No Such File or Directory Error: No Installed Version usage: n [Options / Env] [Command] [Args]
   
2. Install a Node version

node版本管理工具n包使用教程详解

I installed my Node version:

~ Node -Vv6.11.1 ~ where node / usr / local / bin / node

First, you must select a version, specifically view the following link to find a required version:
 https: // GithUb.com/nodejs/node/tree/master/doc/changelogs Install a version: 

node版本管理工具n包使用教程详解 ~ SUDO N 8.12.0 Install: Node- V8.12.0 mkdir: /usr/local/n/versions/node/8.12.0 fetch: https://nodejs.org/dist/v8.12.0/node-v8.12.0-darwin-x64.tar.gzinstalled: v8 .12.0


After the first installation is successful, Node will automatically switch to this version, and the previous version will be lost.

3. Some use commands
 3.1 Install or use a version:  n Node-Version  
When using command n 8.12.0
:

This version is installed when the 8.12.0 version is not installed.
If the 8.12.0 version is already installed, this Node version is switched.

3.2 View all installed NODE versions:

N node版本管理工具n包使用教程详解

can be re-entered

n command to view all installed Node versions. In the display version interface, you can use the up and down arrow to select the Node version you want to use, and then press Enter to select.

Press

Q or Control + C

to exit Node version list:



~ n node / 8.12.0ο Node / 9.11.2

3.3 Using or installing the latest official release:

n Latest

3.4 Using or installing stable official release: n stable 3.5 Using or installing the latest LTS official version:
N lts
3.6 Delete a Node version: N rm 0.9.4 Remove some version:

N RM 0.9.4 V0.10.0
[ Alternatively, –
 is used instead of  RM : 
N – 0.9.4

3.6.1 Delete All other versions except the current version: N Prune 4 n Pack Tool All Directory of Node Installed I am a MAC system, all of your installed Node version storage path : / usr / local / n / Versions / Node

5. I encountered problems
5.1 Error: Sudo Required Installing a Node version is, prompt error: sudo required ,

Use

SUDO N 8.12.0

6. Reference information

N: https: //www.npmjs.com/package/n

Node All History: HTTPS : //github.com/nodejs/node/tree/master/doc/changelogs

The above is the full content of this article, I hope to help everyone, I hope everyone will support Tumi Cloud..

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment