How to install npm in Linux
How to install npm in Linux? (ubuntu base)
You can install npm in Linux using this command. First, open your computer terminal. You can start the terminal manually or using this command.
Ctrl > Alt > T at the same time. Your terminal will be run. When your terminal starts completely, command this line.
Now install node.js on your computer using this command:
sudo apt install nodejs
Now check the NPM version:
You can check the node.js version:
Sometimes node.js doesn’t install on some computers. It isn’t a problem. You need to update your apt.
Read more: Linux Lite Review 2022
Upgrade the apt using this command:
sudo apt-get update
sudo apt-get upgrade
Then install the node.js now. I hope it will be solved.
There is another method you can install node.js using this way.
First, you need to install python for this.
Install python using this code:
sudo apt-get install python-software-properties
Now download node.js using this command:
curl -sL https://deb.nodesource.com/setup_17.x | sudo -E bash –
Note: Here, we are installing node.js version 17, if you want to install a newer version, you can replace setup_17.x with setup_18,19….x.
Now install it on your pc using this command:
sudo apt-get install nodejs
Check Node version: