Not able to install npm on Ubuntu

+2 votes

I am trying to install using this command:

sudo apt-get install npm

But I am getting this error:

Reading package lists... Done

Building dependency tree      

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:


The following packages have unmet dependencies:

 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed

E: Unable to correct problems, you have held broken packages.
Nov 28, 2018 in Linux Administration by digger
• 26,720 points
5,734 views

1 answer to this question.

+2 votes

Try installing npm using aptitude:

sudo apt install aptitude
sudo aptitude install npm
answered Nov 28, 2018 by Omkar
• 69,170 points
I am unable to install npm to linux what is the reason
Hi,

There may be many reasons behind this. If possible, paste your error that you are getting.

Related Questions In Linux Administration

0 votes
1 answer

Not able to install sublime text editor

Delete the following file: /etc/apt/sources.lits.d/sublime-text.list and then try to ...READ MORE

answered Feb 19, 2019 in Linux Administration by Joe
454 views
0 votes
1 answer

Error when trying to install a few packages on ubuntu

Try executing the following commands and try ...READ MORE

answered Mar 15, 2019 in Linux Administration by Jobin
652 views
0 votes
1 answer

Not able to access /etc/sudoers.d/python file

I think your system is not allowing ...READ MORE

answered Feb 6, 2019 in Linux Administration by Lohit
1,078 views
0 votes
3 answers

How to uninstall Apache2 on Ubuntu?

apache2 is a meta package that just selects ...READ MORE

answered Dec 14, 2020 in Linux Administration by Gitika
• 65,950 points
87,266 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,230 points
367 views
0 votes
1 answer

Error installing npm

Npm depends on NodeJS to run/get installed. ...READ MORE

answered Feb 9, 2019 in Linux Administration by Omkar
• 69,170 points
332 views
0 votes
2 answers

Install postgreSQL on Ubuntu

Follow the below commands to install PostgreSQL (PSQL) ...READ MORE

answered Nov 12, 2020 in Database by Prachi
• 140 points
308 views
0 votes
1 answer

How to check version of package installed by npm?

These commands are used to check the ...READ MORE

answered Feb 5, 2019 in Linux Administration by Omkar
• 69,170 points
1,837 views
+2 votes
2 answers

Ubuntu installing problem

Hey Prince! This seems to be like a ...READ MORE

answered Oct 15, 2018 in Linux Administration by Omkar
• 69,170 points

edited Oct 15, 2018 by Kalgi 224 views