NodeJS 已安装但无法运行 [英] NodeJS is already installed but won't run
本文介绍了NodeJS 已安装但无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的 VPS 服务器上运行 Ubuntu 18,我正在尝试运行 NodeJS,但是,发生了这种情况:
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:~$
它说要安装包来运行 nodejs,但是,尝试安装 nodejs 它说它已经安装了这是怎么回事?
It says to install the package to run nodejs, however, trying to install nodejs it says it's already installed What is going on?
推荐答案
尝试运行:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
或者如果你想要节点 10.
Or if you want node 10.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
这篇关于NodeJS 已安装但无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文