How To Install Node.js And NPM On Ubuntu 19.10

Node.js is a javascript platform for general-purpose programming that allows users to build a network application. We can install the latest nodejs and npm version on ubuntu. let’s see, how to install node js using the repository.

We need to add a PPA repository using the below commands for Node.js stable version 12.

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

If you require to install the latest version 13, you may run the below commands.

Check Out: How To Create Automatic Backup of Volumes And EC2 On Amazon cloud

curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -

Commands for version 11 and version 10

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

you want to install another version rather than just simply change the version in the above command.

Once you run the commands, there’re lots of dependencies where we will install them one by one.

how to install node

Install required packages using apt-get install gcc g++ make

Check Out: DPKG Error Parsing File ‘/var/lib/dpkg/updates/0008 In Ubuntu 19.04

Install the yarn packages using the below commands.

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Check Out: Install Tomcat 10 Server Using Source Code On Linux 8

Install yarn using apt-get update && apt-get install yarn

Install nodejs using apt install nodejs

install npm ubuntu

Check nodejs and npm version using the below command.

node -v && npm -v

install nodejs on ubuntu

Check Out: How To Install Ubuntu Server 18.04 On Vmware Workstation

we’ve successfully installed nodejs 12 and npm version on the ubuntu machine.

You can also update your NPM version using npm install npm -–global

You’re done

Rate this article

Leave a Reply

avatar
  Subscribe  
Notify of