我需要运行 nodejs v10.14。我目前运行的是 8.16.0 版。我找到了一些我遵循的说明,但它会导致错误(见下文)。
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
This causes the following output:
## Installing the NodeSource Node.js 10.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:29 http://ppa.launchpad.net/wireshark-dev/stable/ubuntu bionic InRelease
Err:31 http://ppa.launchpad.net/ehoover/compholio/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Err:32 http://ppa.launchpad.net/pipelight/stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/ehoover/compholio/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/pipelight/stable/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting
Run Code Online (Sandbox Code Playgroud)
知道如何安装 nodejs v10.14(或更高版本)吗?
Hop*_*tch 10
您的错误似乎是建立 APT 缓存的问题——curl 中的链接响应无效(请参阅错误堆栈中的 404 错误)...
如果是连接问题,不确定这是否真的有效,但是您可以尝试删除 nodejs 安装,更新您的软件包并使用 teh 12.x curl 重新安装 nodejs 12.x,例如。
要删除并重新安装 Node 和 NPM:
首先删除节点:
sudo apt-get remove nodejs npm
Run Code Online (Sandbox Code Playgroud)
然后更新和升级:
sudo apt-get update
sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)
然后获取你想要的 Node 版本:
//where setup_12.x, replace with desired major version
curl -sL deb.nodesource.com/setup_12.x | sudo -E bash -
Run Code Online (Sandbox Code Playgroud)
然后安装你的新节点版本:
sudo apt-get install -y nodejs
Run Code Online (Sandbox Code Playgroud)
那应该这样做。您可以通过以下方式检查当前版本:
node -v
npm -v
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!
| 归档时间: |
|
| 查看次数: |
22404 次 |
| 最近记录: |