Simplified Guide to Installing NVM on Ubuntu

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…


This content originally appeared on DEV Community and was authored by Sonu Kumar

Guide to Installing NVM on Ubuntu

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

  1. Update Your System:
   sudo apt update
  1. Install Curl:
   sudo apt install curl
  1. Download and Install NVM:
   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
  1. 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
  1. Verify NVM Installation:
   nvm --version
  1. Install Node.js Using NVM:
   nvm install node
  1. Set Default Node.js Version:
   nvm alias default node
  1. Check Installed Node.js Version:
   node --version

Managing Node.js Versions

  • Install Specific Version:
  nvm install <version>
  • Switch Node.js Version:
  nvm use <version>
  • List Installed Versions:
  nvm ls
  • Uninstall Node.js Version:
  nvm uninstall <version>

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
Image description

To learn about the Docker basics please have a look:
What is Docker and why do we use it?


This content originally appeared on DEV Community and was authored by Sonu Kumar


Print Share Comment Cite Upload Translate Updates
APA

Sonu Kumar | Sciencx (2024-06-26T12:13:47+00:00) Simplified Guide to Installing NVM on Ubuntu. Retrieved from https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/

MLA
" » Simplified Guide to Installing NVM on Ubuntu." Sonu Kumar | Sciencx - Wednesday June 26, 2024, https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/
HARVARD
Sonu Kumar | Sciencx Wednesday June 26, 2024 » Simplified Guide to Installing NVM on Ubuntu., viewed ,<https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/>
VANCOUVER
Sonu Kumar | Sciencx - » Simplified Guide to Installing NVM on Ubuntu. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/
CHICAGO
" » Simplified Guide to Installing NVM on Ubuntu." Sonu Kumar | Sciencx - Accessed . https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/
IEEE
" » Simplified Guide to Installing NVM on Ubuntu." Sonu Kumar | Sciencx [Online]. Available: https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/. [Accessed: ]
rf:citation
» Simplified Guide to Installing NVM on Ubuntu | Sonu Kumar | Sciencx | https://www.scien.cx/2024/06/26/simplified-guide-to-installing-nvm-on-ubuntu/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.