在Debian上找不到node:命令 [英] node: command not found on Debian

查看:193
本文介绍了在Debian上找不到node:命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在使用mac和webserver,我安装了Debian 8。但是,我目前正在处理一个在本地主机上开发的节点应用程序,大部分时间都可以正常工作,我可以使用 node index.js 而不会出现问题。

So, I'm working on a mac and as webserver, I got Debian 8 installed. However, I'm currently working on a node application which I developed on my localhost most of the time, where everything works fine - I can use node index.js without issues.

但是,我通过node.js网站的建议安装了我的网络服务器节点,这是...

However, I installed node on my webserver via the recommendation of the node.js website, which is ...

sudo apt-get install -y nodejs

。 ..没有任何错误。之后,我可以使用npm命令。但是当我尝试执行 node index.js 时,我收到 bash:node:command not found 。另外,节点没有安装在我的 / usr / local / bin 文件夹中。所以我甚至不能通过 / usr / local / bin / node 运行,这是建议这里

... which didn't throw any errors. After that, I could use the npm command. But when I try to execute node index.js, I receive bash: node: command not found. Also, node is not installed in my /usr/local/bin folder. So I can't even run in via /usr/local/bin/node which was recommended here.

那么我做错了什么?我现在很困惑,真的不知道如何解决问题。

So what exactly did I do wrong? I'm rather confused right now and really don't know how to fix the problem.

推荐答案

你以前安装过节点包?如果是这样,请尝试:

Did you previously install node package, too? If so, try:

$ sudo apt-get --purge remove node
$ sudo apt-get --purge remove nodejs
$ sudo apt-get install -y nodejs-legacy

# check
$ node --version
v4.0.0

另请参阅此答案

这篇关于在Debian上找不到node:命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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