NVM (Node Version Manager) is a tool that allows you to manage multiple versions of Node.js on a single machine. This guide will show you how to install and use NVM on Debian 11.

Step 1: Update Your System

Start by ensuring your system is up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Packages

To install NVM, you'll need to have curl installed on your system. Install it using the following command:

sudo apt install curl -y

Step 3: Download and Install NVM

Download the NVM installation script using curl:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash

This command will download the installation script and execute it.

Step 4: Activate NVM

After installation, you need to activate NVM by adding the following lines to your profile script:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

You can do this by running:

echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc
source ~/.bashrc

Step 5: Verify NVM Installation

Check if NVM is installed correctly by running:

nvm --version

Step 6: Install Node.js Using NVM

Now you can install Node.js versions easily. For example, to install the latest version of Node.js, run:

nvm install node

You can also install a specific version, for example:

nvm install 14.17.0

Step 7: Use Node.js Version

To use a specific version of Node.js, you can run:

nvm use 14.17.0

You can check the currently active version of Node.js by running:

node -v

Conclusion

You have successfully installed and configured NVM on Debian 11. This tool will allow you to manage multiple versions of Node.js easily.

If you're looking for a reliable hosting solution for your Node.js applications, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.

For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your needs.

Was dit antwoord nuttig? 0 gebruikers vonden dit artikel nuttig (0 Stemmen)