Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs pm2 error on app startup

I am trying to run a nodejs application I built on my windows machine unto my Ubuntu Server 14.04.

I have installed nodejs and pm2 hovewer when I try to start the pm2's web interface using pm2 web or start my nodejs app using pm2 start myapp.js, it throws this error: /usr/bin/env: node: No such file or directory

Am I doing something wrong?

like image 227
Adr Avatar asked Mar 16 '15 02:03

Adr


People also ask

What is pm2 in Nodejs?

PM2 is a Node. js process manager that comes with a built-in load balancer. It helps facilitate production deployments and enables you to keep running applications alive indefinitely (even when accidents occur).

How do you reset pm2 service?

Restart on file change To totally disable the watch feature, do: pm2 stop app --watch or toggle the watch option on application restart via pm2 restart app --watch .


1 Answers

You must run following command in console:

sudo ln -s /usr/bin/nodejs /usr/local/bin/node

and try again to run the node app.

like image 109
Raugaral Avatar answered Sep 22 '22 10:09

Raugaral