zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

foreverpath not found #92

Open vyatsun opened 7 years ago

vyatsun commented 7 years ago

I'm trying to install a service with forever-service with the command:

sudo forever-service install webserver --script server.js -e "PORT=80"

but getting the following error:

forever-service version 0.5.9

Platform - Ubuntu 14.04.5 LTS
foreverpath not found
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at Command.<anonymous> (/usr/lib/node_modules/forever-service/bin/forever-service:89:34)
    at Command.listener (/usr/lib/node_modules/forever-service/node_modules/commander/index.js:249:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:194:7)
    at Command.parseArgs (/usr/lib/node_modules/forever-service/node_modules/commander/index.js:480:12)
    at Command.parse (/usr/lib/node_modules/forever-service/node_modules/commander/index.js:372:21)
    at /usr/lib/node_modules/forever-service/bin/forever-service:175:23
    at Walker.<anonymous> (/usr/lib/node_modules/forever-service/lib/platforms.js:28:3)

Nodejs version is 8.0 Any ideas how to fix that?

TrevorVonSeggern commented 7 years ago

For me what fixed the issue was installing forever as sudo.