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,740 points
7,730 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,210 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
794 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
1,378 views
0 votes
0 answers

How to install the npm command on the linux

I'm trying to install the npm ci command on Linux. ...READ MORE

Apr 21, 2022 in Linux Administration by Edureka
• 13,670 points
298 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,867 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,240 points
960 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,210 points
761 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
934 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,210 points
2,572 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,210 points

edited Oct 15, 2018 by Kalgi 959 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP