Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVM (Node Version Manager) Commands #234

Open
Qingquan-Li opened this issue Apr 6, 2023 · 0 comments
Open

NVM (Node Version Manager) Commands #234

Qingquan-Li opened this issue Apr 6, 2023 · 0 comments

Comments

@Qingquan-Li
Copy link
Owner

Reference: https://github.com/nvm-sh/nvm

1. nvm install Node.js

To download, compile, and install the latest release of node, do this:

$ nvm install node # "node" is an alias for the latest version

To install a specific version of node:

$ nvm install 14.7.0 # or 16.3.0, 12.22.1, etc

The first version installed becomes the default. New shells will start with the default version of node (e.g., nvm alias default).

To install the latest Node.js LTS version:

$ nvm install --lts
Installing latest LTS version.
...
Now using node v18.15.0 (npm v9.5.0)

2. Uninstall a Node.js Version

$ nvm uninstall 18.15.0
Uninstalled node v18.15.0

You may need to uninstall a Node.js version as root (on macOS):

$ sudo -s # root
Password:
# nvm uninstall 18.15.0
Uninstalled node v18.15.0
# exit
$

3. List Node.js Versions

If you want to see what versions are installed:

$ nvm ls
nvm ls
       v18.13.0
->     v18.15.0
         system
default -> node (-> v18.15.0)

If you want to see what versions are available to install:

$ nvm ls-remote

path to the executable to where it was installed:

$ nvm which 18.15
/Users/yourusername/.nvm/versions/node/v18.15.0/bin/node

4. Use a Different Node.js Version

$ nvm use system 
Now using system version of node: v16.16.0 (npm v8.16.0)

$ nvm ls        
       v18.13.0
       v18.15.0
->       system
default -> node (-> v18.15.0)
...

$ nvm use 18.15  
Now using node v18.15.0 (npm v9.5.0)
@Qingquan-Li Qingquan-Li changed the title NVM Commands NVM (Node Version Manager) Commands Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant