I'm trying install Node.js on Ubuntu 12.10, but the terminal shows me an error about lost packages. I tried with this:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
But when I came to the last line sudo apt-get install nodejs npm
shows this error:
Failed to install some packages. This may mean that
you requested an impossible situation or if you are using the distribution
distribution that some required packages have not yet been created or been
been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs: Conflicts: npm
E: Failed to correct problems, you have held broken packages.
Then I uninstalled the ppa:chris-lea/node.js
and I was trying a second option:
sudo apt-get install node.js
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
The same error, the terminal says npm is the latest version
but also shows me the text I shown in the top. I think the problem is ppa:chris-lea/node.js
but I don't know how solve it.
My
apt-get
was old and busted, so I had to install from source. Here is what worked for me:These steps were mostly taken from joyent's installation wiki
I personally do it this way:
If you want to install particular version than download the version you want from nodejs site and execute the last tree steps.
I would strongly suggest not using the default nodejs package from the distro market because it would be probably outdated. (i.e. the current for the time of writing this in the ubuntu market is v0.10.25 which is too outdated compared to the latest (v0.12.0)).
You can use nvm to install nodejs. It allows you work with different versions without conflicts.
just use nvm for node version control nvm
Simply follow the instructions given here:
Don't give
sudo apt-get install nodejs npm
justsudo apt-get install nodejs
http://jstricks.com/install-node-js/