node: command not found on Debian

Kernels & Hardware, configuring network, installing services

node: command not found on Debian

Postby Sofia951 » 2018-12-18 04:23

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 ...

Code: Select all
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.
Sofia951
 
Posts: 2
Joined: 2018-11-02 09:23

Re: node: command not found on Debian

Postby cronoik » 2018-12-18 09:24

You have to install nodejs-legacy to execute
Code: Select all
node something

Please note that node should only be used for legacy applications. Other applications should use nodejs:
Code: Select all
nodejs something
Have a nice day!
cronoik
 
Posts: 308
Joined: 2015-05-20 21:17


Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable