首页 > 解决方案 > 在 Linux 上安装 Node 版本

问题描述

我已经启动了一个 Ubuntu AWS EC2 实例并想安装 Node 10.13.0。

我检查了以下内容:

sudo apt-get update
sudo apt-cache madison nodejs

这仅列出了 8.x 的版本。所以我这样做:

curl -sL https://deb.nodesource.com/setup_10.13.0 | sudo -E bash -

这给了我这个错误:

bash: line 1: html: No such file or directory
bash: line 2: syntax error near unexpected token `<'
'ash: line 2: `<head><title>404 Not Found</title></head>

在线文档说这样做:

sudo apt-get install nodejs

但这不允许我指定版本号。我什至试过这个:

sudo apt-get install nodejs=10.13.0

这给了我这个错误:

Version '10.13.0' for 'nodejs' was not found

我如何通过几个简单的命令来实现这一点?请注意,LTS 版本当前是 10.14.0,我想要 10.13.0。

标签: linuxbashubuntucurl

解决方案


尝试节点版本管理器。不需要root权限。


推荐阅读