I keep forgetting these commands. So, let's put is all together.
Installing
- Follow installation steps:
List Available Releases
nvm ls-remote
nvm ls-remote | grep -i "latest"
nvm ls-remote | grep i "<node_version>"
Install a Node Version
nvm install <node_version>
List Installed Versions
nvm ls
Aliasing
- Set a specific version as default
nvm alias default <node_version>
- Set a user defined alias to a node version
nvm alias <alias_name> <node_version>
- Remove the alias name
nvm unalias <alias_name>
Switch to a version (Use)
# don't have to match exact number. `nvm use 16`
nvm use <node_version>
# or use the latest
nvm use --lts
Get path to installed node
# /Users/pratikthapa/.nvm/versions/node/v20.10.0/bin/node
nvm which node
Uninstall a Version of NodeJs
nvm uninstall <node_version> # a specific version
nvm uninstall --lts # Uninstall the latest LTS release
Help
nvm --help # get help documents
Top comments (0)