Mikita Melnikau
Mikita Melnikau

Reputation: 1765

Forever dont want to start

I learning NodeJS. I have ubuntu 16 server with installed nodejs. Then i install globally express-generator and forever. Next i maked a folder into /var/www named as hack-it-up.ru and used express-generator to generate the app. Next i changed port of my app as 8081 and tryed to start it with npm start. All works fine. But... when i tryed to start my app with forever, i got errors. I readed lots of guides but didnt solved it. Help me please. Thanks!

root@ashipka:/var/www/hack-it-up.ru# forever start  -l /var/www/forever-logs/hack-it.log -a app.js
warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: app.js
root@ashipka:/var/www/hack-it-up.ru# forever list
info:    Forever processes running
data:        uid  command             script forever pid   id logfile                           uptime
data:    [0] aj4I /usr/local/bin/node app.js 27060   27066    /root/.forever/aj4I.log           STOPPED
data:    [1] wFf4 /usr/local/bin/node app.js 27147   27153    /var/www/forever-logs/hack-it.log STOPPED
root@ashipka:/var/www/hack-it-up.ru# forever stop 0
error:   Forever cannot find process with id: 0

Upvotes: 0

Views: 579

Answers (1)

Mikita Melnikau
Mikita Melnikau

Reputation: 1765

I needed to start from bin/www file instead of app.js as said Mohit Bhardwaj. Thanks! All works fine.

Upvotes: 1

Related Questions