2
sudo apt-get install npm

then I get this:

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

even tough nodejs exists on the system, should I install separately each dependency how can I install them in one bunch?

also I've tried this:

sudo apt-get install nodejs-dev

and I get this:

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:
 nodejs-dev : Depends: nodejs (= 0.10.25~dfsg2-2ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

why it say's that nodejs doesn't exist, if it is on the system already installed?, if its broken how could I fix it? I've tried to remove it and install again, but didn't helped, any ideas?

EDIT

npm:
  Installed: (none)
  Candidate: 1.3.10~dfsg-1
  Version table:
     1.3.10~dfsg-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
nodejs:
  Installed: 4.2.1-2nodesource1~trusty1
  Candidate: 4.2.1-2nodesource1~trusty1
  Version table:
 *** 4.2.1-2nodesource1~trusty1 0
        500 https://deb.nodesource.com/node_4.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
node-abbrev:
  Installed: 1.0.4-2
  Candidate: 1.0.4-2
  Version table:
 *** 1.0.4-2 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-ansi:
  Installed: 0.2.1-1
  Candidate: 0.2.1-1
  Version table:
 *** 0.2.1-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-archy:
  Installed: 0.0.2-1
  Candidate: 0.0.2-1
  Version table:
 *** 0.0.2-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

1 Answers1

1

First we try to force the installation of the necessary packages

sudo apt-get install node-abbrev node-ansi node-archy 
sudo apt-get install --reinstall nodejs

And after apt-cache policy npm nodejs node-abbrev node-ansi node-archy you have this

npm:
  Installed: (none)
  Candidate: 1.3.10~dfsg-1
  Version table:
     1.3.10~dfsg-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
nodejs:
  Installed: 4.2.1-2nodesource1~trusty1
  Candidate: 4.2.1-2nodesource1~trusty1
  Version table:
 *** 4.2.1-2nodesource1~trusty1 0
        500 https://deb.nodesource.com/node_4.x/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.10.25~dfsg2-2ubuntu1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
node-abbrev:
  Installed: 1.0.4-2
  Candidate: 1.0.4-2
  Version table:
 *** 1.0.4-2 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-ansi:
  Installed: 0.2.1-1
  Candidate: 0.2.1-1
  Version table:
 *** 0.2.1-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
node-archy:
  Installed: 0.0.2-1
  Candidate: 0.0.2-1
  Version table:
 *** 0.0.2-1 0
        500 http://kg.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

And since I get no further feedback from you

sudo rm /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs=0.10.25~dfsg2-2ubuntu1
sudo apt-get install -f
sudo apt-get install npm
A.B.
  • 92,125