Introduction
Managing multiple versions of Node.js on your Ubuntu system is crucial for development. Node Version Manager (NVM) simplifies this process, allowing you to switch between different versions effortlessly.
Step-by-Step Installation
- Update Your System: ```
sudo apt update
2. **Install Curl**:
sudo apt install curl
3. **Download and Install NVM**:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
4. **Activate NVM**:
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
5. **Verify NVM Installation**:
nvm --version
6. **Install Node.js Using NVM**:
nvm install node
7. **Set Default Node.js Version**:
nvm alias default node
8. **Check Installed Node.js Version**:
node --version
#### Managing Node.js Versions
- **Install Specific Version**:
nvm install
- **Switch Node.js Version**:
nvm use
- **List Installed Versions**:
nvm ls
- **Uninstall Node.js Version**:
nvm uninstall
#### Conclusion
Using NVM on Ubuntu provides flexibility and control over your Node.js environment, making development smoother and more efficient.
To know how to install the NVM on Windows please have a look:
[How to install NVM(Node Version Manager) on Windows](https://dev.to/mesonu/how-to-install-nvmnode-version-manager-on-windows-2ij1)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skqz3ml9uk79n5q89eyu.png)
To learn about the Docker basics please have a look:
[What is Docker and why do we use it?](https://medium.com/@me.sonu300/what-is-docker-and-why-do-we-use-it-c86b11559b3b)
Top comments (0)