Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I followed this gist https://gist.github.com/Goddard/5500157 to install nodejs and npm, but after running it neither node --version or npm --version could be ran, giving an error of command not found. I was able to uninstall nodejs, but had to go into the temp directory described in the script and do a make uninstall to get npm to leave.

Now in an attempt to install nodejs and npm again i used this link instead http://www.andreagrandi.it/2013/02/08/how-to-install-latest-stable-node-js-on-ubuntu/ , but if I try and install both nodejs and npm together I get this error message.

sudo apt-get install nodejs npm

The following packages have unmet dependencies:
   nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.

If I just install nodejs that works fine.

sudo apt-get install nodejs

node --version
v0.10.15

But now if I try to install npm it gives me this error message

sudo apt-get install npm 

The following packages have unmet dependencies:
npm : Depends: nodejs (>= 0.6.19~dfsg1-3) but it is not going to be installed
   Depends: nodejs-dev
   Depends: node-node-uuid but it is not going to be installed
   Depends: node-request but it is not going to be installed
   Depends: node-mkdirp but it is not going to be installed
   Depends: node-minimatch but it is not going to be installed
   Depends: node-semver but it is not going to be installed
   Depends: node-ini but it is not going to be installed
   Depends: node-graceful-fs but it is not going to be installed
   Depends: node-abbrev but it is not going to be installed
   Depends: node-nopt but it is not going to be installed
   Depends: node-fstream but it is not going to be installed
   Depends: node-rimraf but it is not going to be installed
   Depends: node-tar but it is not going to be installed
   Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I am using Ubuntu 13.04. Any help is appreciated. I dont know much about node.js and npm. I was trying to start learning how to use these so probably my in-experience is showing.

share|improve this question
2  
The nodejs package you installed from the PPA includes npm since v0.10.0. In other words - you should have npm installed already (because of sudo apt-get install nodejs). Try to run npm to confirm. Also see the offical installation guide (the one you followed is a copy of it, but the official one has a few extra details). –  cyberx86 Aug 7 '13 at 17:38
    
Thank you -- you are right everything works correctly if you just install nodejs and then run npm --version. I didn't think about checking whether they came together, I just assumed they were separate. –  lumberjacked Aug 9 '13 at 1:03

1 Answer 1

up vote 3 down vote accepted

The nodejs package you installed from the PPA includes npm since v0.10.0. Since you have v0.10.15, when you ran sudo apt-get install nodejs you also installed npm. Try to run npm to confirm.

Also see the offical installation guide (the one you followed is a copy of it, but the official one has a few extra details).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.