[英]Installing NodeJS 4.4.7 or later on Ubuntu 16.04 server
为了运行使用最新版本的Meteor创建的Meteor应用,我需要在Ubuntu 16.04服务器上安装Node.js 4.4.7或更高版本。 我完全按照DigitalOcean教程中的说明进行操作:
cd ~
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
但是,当我执行脚本时,经过许多似乎没有错误终止的Get和Ign进程后,我收到一个404 Not Found
错误,然后通知有关Error executing command, exiting
:
...
Ign:13 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en
Err:7 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main amd64 Packages
404 Not Found
Ign:9 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main i386 Packages
Ign:11 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en_GB
Ign:13 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en
Fetched 190 kB in 2s (74.5 kB/s)
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting
我已经能够使用sudo apt-get install nodejs
4.2.6,但无法更新到较新版本。 我想念什么?
我发现以下步骤可以解决此问题:
sudo apt-get update
sudo apt-get install build-essential libssl-dev curl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
关闭并重新打开终端会话
source ~/.profile
nvm ls-remote
nvm install v4.4.7
nvm use v4.4.7
node -v
显示:
v4.4.7
来源: 使用节点版本管理器(NVM)安装
注意: curl <url> | bash
curl <url> | bash
需要信任下载脚本的提供者。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.