Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Quick Tip: Install Node.js on Ubuntu

. This ensures that the desired version is used whenever you open a new terminal session.NVM allows you to switch between different installed Node.js versions easily. To switch to a specific Node.js version, execute the command nvm use in the terminal.For example, to switch to version 14.19.0, type nvm use 14.19.0. This command will activate the specified version, allowing you to test your applications with different Node.js versions or use the features of a specific version.If you ever need to remove Node.js from your Ubuntu system, the process will depend on the installation method you used. If you installed Node.js using the apt package manager (using Method 1 or Method 2 described above), you can uninstall it by executing the command sudo apt remove nodejs in the terminal. This command will effectively remove the Node.js package from your system.If you installed Node.js using NVM (Method 3), you can uninstall a specific version by executing the command nvm uninstall . Before uninstalling the currently active version, you need to deactivate it by executing the command nvm deactivate. This will allow you to uninstall the active version without any issues.In this guide, we covered three different methods for installing Node.js on Ubuntu: using the default Ubuntu repositories, the NodeSource repository, and NVM (Node Version Manager). Each method has its advantages and is suitable for different scenarios. To install Node.js 20 on Ubuntu 20.04 LTS, run the following commands in a terminal window: sudo apt update, sudo apt upgrade, sudo apt install -y curl, curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -, and sudo apt install -y nodejs. Verify the version with node --version.To verify sudo privileges, run the command sudo whoami and enter your password when prompted.To switch between Node.js versions installed using NVM, simply execute the command nvm use in the terminal. See our guide to using NVM here.To uninstall Node.js from Ubuntu, you can use either the apt package manager or NVM.Dianne is SitePoint's newsletter editor. She especiallly loves learning about JavaScript, CSS and frontend technologies.© 2000 – 2023 SitePoint Pty. Ltd.This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Quick Tip: Install Node.js on Ubuntu

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×