How to install and use NVM (Node Version Manager) to switch NodeJS Versions
Coder Gautam
Today lets see How to install and use NVM (Node Version Manager) to switch NodeJS Versions. This works in Windows, Mac, and Linux. NVM stands for Node Version Manager and is a popular way for you to manage multiple versions of nodejs at once and easily switch between them.
Commands:
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
I would recommend you restart terminal after this (and you can be done), but if you choose not to, then run the following commands to finish set up.
- export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Links: GUIDE: https://github.com/nvm-sh/nvm/blob/master/README.md#install--update-script
Nvm-Windows install: https://github.com/coreybutler/nvm-windows/releases/tag/1.1.11
Install cURL for Mac (optional): https://formulae.brew.sh/formula/curl ... https://www.youtube.com/watch?v=Uvz340hj0ss
2023-09-03
0.0 LBC
Copyrighted (contact publisher)
43240376 Bytes