When i try to install npm with sudo apt-get install npm
, i get following error:
E: Unable to locate package npm
Why can't apt find npm? Im using Debian 9 and already sudo apt-get install nodejs
.
When i try to install npm with sudo apt-get install npm
, i get following error:
E: Unable to locate package npm
Why can't apt find npm? Im using Debian 9 and already sudo apt-get install nodejs
.
This will resolve your error. run these command in your terminal. these commands will add the older versions. you can update them later or can change version here too before running these commands one by on.
Encountered this in Ubuntu for Windows, try running first
then
If you have installed nodejs, then you also have npm. Npm comes with node.
Download the the repository key with:
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
Then setup the repository:
$ sudo sh -c "echo deb https://deb.nodesource.com/node_8.x cosmic main \
Your system can't find npm package because you haven't add nodejs repository to your system..
Try follow this installation step:
Add nodejs PPA repository to our system and python software properties too
Then install npm
Check if npm and node was installed and you're ready to use node.js
Check if npm or node folder still exist, delete it if you found them
I ran into the same issue on Debian 9.2, this is what I did to overcome it.
Installation
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install -y nodejs
sudo apt-get install -y npm
Check installed versions
node --version
npm --version
Originally sourced from "How to install Node.js LTS on Debian 9 stretch" http://linuxbsdos.com/2017/06/26/how-to-install-node-js-lts-on-debian-9-stretch/