NodeJS is already installed but won't run

2019-08-16 02:10发布

I'm running Ubuntu 18 on my VPS server, and I'm trying to run NodeJS, however, this happens:

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:~$ 

It says to install the package to run nodejs, however, trying to install nodejs it says it's already installed What is going on?

1条回答
Bombasti
2楼-- · 2019-08-16 02:19

Try running:

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

Or if you want node 10.

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
查看更多
登录 后发表回答