How to install NVM (Node Version Manager) in Garuda linux or Arch Linux based
Here are the steps to install NVM in Garuda Linux:
1. Check your default shell:
Open a terminal and run
echo $SHELL
to determine your current shell.If it's not Bash or Zsh, you'll need to switch to one of them for NVM to work properly. You can change your default shell using Garuda's settings or by editing your
~/.profile
file.
2. Install NVM:
Choose one of the following methods:
Using the Arch User Repository (AUR):
- Run
yay -S nvm
to install NVM from the AUR.
- Run
Manual installation:
Run the following command in your terminal: Bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
3. Activate NVM in your current session:
- Run
source ~/.bashrc
(orsource ~/.zshrc
if you're using Zsh).
4. Verify installation:
- Run
nvm --version
to check if NVM is installed correctly.
5. Install Node.js versions:
Use NVM to install different Node.js versions: Bash
nvm install <version>
(e.g.,
nvm install 18.12.1
)
6. Use different Node.js versions:
Switch between installed versions: Bash
nvm use <version>
Check the currently used version: Bash
nvm current
Additional notes:
Fish shell: If you prefer Fish shell, consider using
fisher
to manage plugins, as NVM doesn't have native Fish support.PATH variable: Ensure the path to NVM's bin directory is included in your PATH environment variable.
Troubleshooting: If you encounter issues, refer to the NVM documentation (https://github.com/nvm-sh/nvm) for further guidance.
Subscribe to my newsletter
Read articles from Rendy Saputra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Rendy Saputra
Rendy Saputra
Full-stack developer with mastery across mobile (React Native, Ionic), front-end (React, Svelte, Vue.js), back-end (Express.js, FastAPI, Django), e-commerce (Shopify, OpenCart), and CMS (Wordpress, Laravel, Drupal, headless). Building web and mobile applications that deliver!