how to install nvm on ubuntu?

To install nvm (Node Version Manager) on Ubuntu, you can follow these steps:

Clone the nvm repository:

curl -o- | bash

Add the following line to your .bashrc or .zshrc file:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"  # This loads nvm

Reload your shell:

source ~/.bashrc   # or source ~/.zshrc

Verify the installation by checking the version:

nvm --version

Now you can install and switch between different Node.js versions using nvm.

Leave a Comment