[英]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.