n - Interactively Manage Your Node.js Versions on macOS
n is a Node.js version management: no sub-shells, no profile setup, no convoluted, just simple.
Supported Platforms
n is supported on macOS, Linux, including with Windows Subsystem for Linux, and various other unix-like systems. It is written as a BASH script but does not require you to use BASH as your command shell.
Installation
Installing Node.js Versions
sudo n install 10
node/16.13.1
ο node/8.11.3
node/17.3.0
Use up/down arrow keys to select a version, return key to install, d to delete, q to quit
Removing Node.js Versions
sudo n rm 10
Remove all downloaded/cached versions except the installed version:
To Know the path of the downloaded node version:
You can show the path of the downloaded node version:
% n which 12.22.8
/usr/local/n/versions/node/12.22.8/bin/node
Using Downloaded Node.js Versions Without Reinstalling
Command for working directly with your downloaded versions of Node.js, without reinstalling.
% n run 12.22.8
Miscellaneous
Display downloaded Node.js versions and install selection:
sudo n
Install the latest Node.js release:
sudo n latest
Install the latest LTS Node.js release:
sudo n lts
Output downloaded versions:
n ls
Output the latest Node.js version available:
Display diagnostics to help resolve problems:
Output version of n:
n -V, n --version
Display help information:
n -h, n --help
sudo npm uninstall -g n
Comments
Post a Comment