Error installing npm

0 votes

I am trying to install npm with the following command:

sudo apt-get install npm​

But I am getting this error:

The following packages have unmet dependencies:
 npm : Depends: nodejs but it is not going to be installed
       Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
       Depends: node-ansi but it is not going to be installed
       Depends: node-archy but it is not going to be installed
       Depends: node-block-stream but it is not going to be installed
       Depends: node-fstream (>= 0.1.22) but it is not going to be installed
       Depends: node-fstream-ignore but it is not going to be installed
       Depends: node-github-url-from-git but it is not going to be installed
       Depends: node-glob (>= 3.1.21) but it is not going to be installed
       Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
       Depends: node-inherits but it is not going to be installed
       Depends: node-ini (>= 1.1.0) but it is not going to be installed
....
Feb 9, 2019 in Linux Administration by Sharan
1,015 views

1 answer to this question.

0 votes

Npm depends on NodeJS to run/get installed. The error you are getting is because you are trying to install npm without installing the package it depends on (NodeJS). You will have to install NodeJS first. 

To install NodeJS, run:

$ sudo apt-get install nodejs

and then install npm:

$ sudo apt-get install npm
answered Feb 9, 2019 by Omkar
• 69,230 points

Related Questions In Linux Administration

0 votes
1 answer
0 votes
1 answer

Error while installing Let's Encrypt SSL on My Website

Hi@Hitesh, There may be a firewall issue. Check ...READ MORE

answered Aug 24, 2020 in Linux Administration by MD
• 95,460 points
712 views
0 votes
1 answer

"connect: Network is unreachable?" error on ping

You need to set your default gateway. ...READ MORE

answered Jan 23, 2019 in Linux Administration by Tina
28,837 views
0 votes
1 answer
0 votes
1 answer

how to safely deploy npm install without it causing inconsistencies?

The recent versions on npm generates a ...READ MORE

answered Apr 11, 2018 in DevOps on Cloud by DareDev
• 6,890 points
938 views
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
1,125 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
1,158 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,230 points

edited Oct 15, 2018 by Kalgi 1,189 views
+2 votes
1 answer

Not able to install npm on Ubuntu

Try installing npm using aptitude: sudo apt install aptitude sudo ...READ MORE

answered Nov 28, 2018 in Linux Administration by Omkar
• 69,230 points
8,165 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