NodeJS已安装但无法运行 [英] NodeJS is already installed but won't run

查看:832
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆