简体   繁体   中英

Can't install node.js on Linux server

I followed some instructions to install node.js on a Linux server and ran in to the following blocks. I started out by doing sudo apt-get install python-software-properties and that worked fine. Then, I did sudo add-apt-repository ppa:chris-lea/node.js . But, wait - there is no command add-apt-repository . OK, so I looked it up and it told me to do apt-get install software-properties-common and that would have been fine, except it gave me this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package software-properties-common

Well, what can I do to get node.js on my server? Obviously, none of this works and it's Debian, in case you were wondering. I really need help on this. Basically, how can I install software-properties-common if it does not exist? It just won't show up.

For a Debian install of the latest node.js, you should follow these instructions , not requiring you to add the PPA:

sudo apt-get install python g++ make checkinstall
mkdir ~/src && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
checkinstall #(remove the "v" in front of the version number in the dialog)
sudo dpkg -i node_*

UPDATE: I wrote this a long time ago. Since then, I find using nvm a much less painful way to get node onto machines. As per link, steps are basically reduced to:

  • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
  • nvm install node

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM