繁体   English   中英

无法在Linux服务器上安装node.js

[英]Can't install node.js on Linux server

我按照一些说明在Linux服务器上安装node.js,然后执行以下块。 我首先通过sudo apt-get install python-software-properties ,并且效果很好。 然后,我做了sudo add-apt-repository ppa:chris-lea/node.js 但是,等等-没有命令add-apt-repository 好的,所以我查了一下,它告诉我要做apt-get install software-properties-common ,这很好,除非它给了我这个错误:

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

好吧,我该怎么办才能在服务器上获取node.js? 显然,如果您想知道的话,这些都不起作用,它是Debian。 我真的需要帮助。 基本上,如果不存在software-properties-common ,如何安装? 它只是不会显示。

对于最新的node.js的Debian安装,应遵循以下说明 ,而不要求您添加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_*

更新:我很久以前写了这个。 从那时起,我发现使用nvm可以更轻松地将节点连接到计算机。 按照链接,步骤基本上简化为:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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