NodeJS已经安装但不会运行

时间:2018-05-31 21:59:01

标签: node.js ubuntu vps apt

我在我的VPS服务器上运行Ubuntu 18,我正在尝试运行NodeJS,但是,这种情况发生了:

seth@vps186104:~$ nodejs -v

Command 'nodejs' not found, but can be installed with:

sudo apt install nodejs

seth@vps186104:~$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (8.10.0~dfsg-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
seth@vps186104:~$ 

它说要安装程序包来运行nodejs,但是,尝试安装nodejs它说它已经安装 发生了什么事?

1 个答案:

答案 0 :(得分:2)

尝试跑步:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

或者如果你想要节点10。

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs