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.
However, I installed node on my webserver via the recommendation of the node.js website, which is ...
sudo apt-get install -y nodejs
... 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
See also this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With