In the sphere of software development, staying updated with the latest tool versions is essential. One such tool is the Node Version Manager (NVM), a utility that allows developers to manage and switch between different Node.js versions seamlessly. This article aims to provide you with a detailed walkthrough on installing NVM on Manjaro, an Arch Linux based distribution.
Introduction to NVM
Node Version Manager, commonly known as NVM, is a version manager for Node.js. It enables developers to install and switch between different Node.js versions with ease. This is particularly useful when testing applications across diverse Node.js versions.
Understanding Manjaro
Manjaro is a user-friendly Linux distribution based on Arch Linux. It is known for its cutting-edge software and speed. Before we delve into the installation process, it is worth noting the prerequisites.
Prerequisites
Before you start with the installation of NVM on Manjaro, ensure you have the following:
- An operating system based on Manjaro or any other Arch-based distribution.
- A fresh OS install to mitigate any potential issues.
- SSH access to the server or Terminal access if you’re on a desktop.
- A stable internet connection for downloading and installing packages.
- Access to a Manjaro Linux system with a non-root sudo user or root user.
Step-by-Step Guide on Installing NVM on Manjaro
Step 1: Update Your Package Database
Before you start installing any new software, it is always recommended to update your package database. By doing so, you ensure that you’re installing the latest version of the software and that all the dependencies are up to date. You can update the package database using the following command in the terminal:
sudo pacman -Syu
Step 2: Install NVM
The installation of NVM is straightforward. You can download the installation script from the official NVM GitHub repository using the curl
command. Here is the command:
curl -o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
This command fetches the installation script and executes it. The script clones the NVM repository to ~/.nvm
and adds the necessary lines to your shell profile file to initialize NVM.
Step 3: Configure NVM
After the installation script has run, you need to add the NVM configuration to your profile file. The profile file is a script executed when a new shell session is started. By adding the NVM configuration to this file, you ensure that NVM is available every time you open a new terminal session. Use the following command:
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
This appends the NVM initialization script to your .bashrc
file, one of the profile files used by Bash, the default shell in many Linux distributions.
To verify that NVM is installed correctly, open a new terminal or source your profile file, then run:
nvm --version
Step 4: Install Node.js Using NVM
With NVM installed, you can now install Node.js versions as needed. To see the list of available Node.js versions, use:
nvm ls-remote
To install a specific version of Node.js, run:
nvm install <version>
Replace <version>
with the desired Node.js version number.
After installing Node.js, you can verify the installation by checking the version:
node --version
Congratulations on successfully installing NVM on Manjaro! This comprehensive guide should have provided you with all the steps necessary to install NVM and Node.js on your Manjaro system.
For those who might be struggling with the process or prefer a professional service, Shape.host offers Linux SSD Vps services, which can handle the installation and setup process, starting from just $4.