How To Install  Node JS  In Ubuntu?

By: lemosys infotech pvt ltd

Update Ubuntu  Open the terminal and run: 

sudo apt update

1

Install Node.js Run the following command: 

sudo apt install nodejs

2

Install npm (Node Package Manager) Install npm by running: 

sudo apt install npm

3

Verify Node.js Installation Check Node.js version with: 

node -v

4

Verify npm Installation Confirm npm is installed with: 

npm -v

5

Install Node.js from NodeSource For the latest version, run these commands: 

curl -fsSL  https://deb.nodesource.com/setup_16.x | sudo -E bash -sudo apt install -y nodejs 

6

Verify Installation Check again to see Node.js and npm versions: 

node -v  npm -v 

7

Uninstall Node.js To remove Node.js, run: 

sudo apt remove nodejs

8

Install nvm (Node Version Manager) For managing multiple Node.js versions: 

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

9

Use nvm to Install Node.js 

nvm install node

10

Switch Node.js Versions with nvm 

nvm use <version> 

11

Additional Resources Explore the official Node.js documentation for more tips! 

12

Check Global Packages with npm To see which global packages are installed, run: 

npm list -g --depth=0 

13

Update npm to the Latest Version Use this command to update npm: 

sudo npm install -g npm@latest 

14

Install Yarn as an Alternative Package Manager If you prefer using Yarn over npm: 

sudo npm install -g yarn 

15

Check Node.js Documentation For more detailed information, visit Node.js Official Docs. 

16

Keep Your Ubuntu System Updated To avoid future issues, regularly update your system: 

sudo apt update & sudo apt upgrade

17

Read Complete Guide                 👇

https://www.lemosys.com/

Visit our website

Contact Us