我在我的 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 它说它已经安装了
到底是怎么回事?
最佳答案
尝试运行:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
或者如果你想要 Node 10。
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
关于node.js - NodeJS 已安装但不会运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50633382/