Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart on watch kills script #932

Closed
lukasoppermann opened this issue May 30, 2017 · 1 comment
Closed

Restart on watch kills script #932

lukasoppermann opened this issue May 30, 2017 · 1 comment

Comments

@lukasoppermann
Copy link

lukasoppermann commented May 30, 2017

Hey,

I am having an issue: When forever tries to restart because of a file change it dies.

I am starting it like this: forever start -v --watch --watchedDirectory=/Users/lukasoppermann/code/veare -c ts-node app.ts

No error is shown after a file change, but forever list shows the process as stopped. The error log shows the following:

error: Could not read .foreverignore file.
error: ENOENT: no such file or directory, open '/Users/lukasoppermann/Code/veare/.foreverignore'
Running on http://localhost:8080
error: restarting script because change changed
error: Forever detected script was killed by signal: SIGKILL
error: Script restart attempt #1
Running on http://localhost:8080
Error: listen EADDRINUSE :::8080
at Object.exports._errnoException (util.js:1050:11)
at exports._exceptionWithHostPort (util.js:1073:20)
at Server.setupListenHandle [as _listen2] (net.js:1259:14)
at listenInCluster (net.js:1307:12)
at Server.listen (net.js:1406:7)
at Function.listen (/Users/lukasoppermann/Code/veare/node_modules/express/lib/application.js:618:24)
at Object. (/Users/lukasoppermann/Code/veare/app.ts:22:5)
at Module._compile (module.js:571:32)
at Module.m._compile (/Users/lukasoppermann/Code/veare/node_modules/ts-node/src/index.ts:385:23)
at Module._extensions..js (module.js:580:10)
error: Forever detected script exited with code: 1

What am I doing wrong? Thanks for your help. Please let me know if I can provide any more info to solve this.

Could this be related to #931 and the issue occurs because a process using the same PORT is still running?

Running forever start -v --watch --watchedDirectory=/Users/lukasoppermann/code/veare -c ts-node app.ts again results in a stopped process as well. Same when running restart.
However when I kill all processes manually first, I can start without a problem.

@wcoebergh
Copy link

First, you are trying to allocate a port that is taken (which has nothing to do with Forever):

Error: listen EADDRINUSE :::8080

Secondly, the argument is:

--watchDirectory

not

--watchedDirectory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants