1

给定一个nodejs.makefile包含安装 nodejs/npm 和一些 npm 包的命令,例如:

nodejs:
    sudo add-apt-repository -y ppa:chris-lea/node.js   #install fresh nodejs
    sudo apt-get update
    sudo apt-get install -y nodejs
    sudo npm update -g npm                             #refresh npm
    sudo npm install -g topojson jsdom minimist        #install npm modules
    npm cache clean

然后我运行:

sudo make -f nodejs.makefile

但我被错误阻止在sudo apt-get update级别(命令2):

...     #some messages here
apt-get update
...       #many other messages there
Ign http://fr.archive.ubuntu.com trusty/universe Translation-en_US
W: Failed to fetch http://ppa.launchpad.net/jonoomph/openshot-edge/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/jonoomph/openshot-edge/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/michael-gruz/canon/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/michael-gruz/canon/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
make: *** [nodejs] Error 100

检查后,似乎“错误100 ”只是sudo apt-get update失败的错误消息。但我不明白为什么这种著名nodejs的安装方式实际上失败了,可能是启动板服务器出现故障吗?

如何使它起作用?

4

2 回答 2

2

项目从 Launchpad 移动到 NodeSource。信息在这里这里

您可以改为在 CLI 中执行此操作:

# runs new installer, remove Launchpad repository entry if it exists:
curl -sL https://deb.nodesource.com/setup | sudo bash -    
sudo apt-get -y install nodejs          # install nodejs
sudo npm install npm -g                 # update NPM to latest stable

如果sudo apt-get -y install nodejs失败,请尝试:

 sudo apt-get update
 sudo apt-get -y install nodejs --fix-missing
于 2014-12-28T10:30:22.233 回答
0

现在有来自joyent(主要nodejs支持者)的官方说明。对于 Ubuntu:

sudo apt-get purge nodejs npm                               # clean up the place
curl -sL https://deb.nodesource.com/setup | sudo bash -     # add repository
sudo apt-get install -y nodejs                              # install both nodejs & npm

对于其他 unix 发行版、osx 和 windows,请参阅链接。

于 2014-12-28T12:32:35.897 回答