Npm/node still running after server stops

Phoenix handles stopping by closing the stdin pipe to the node process (as is proper unix/posix methods).

A lot of node software is written by people who do not know how to properly close a program when it is told to stop (it should either fork and persist, or it should kill itself when stdin closes), thus it is node being told to close, but whatever node script you are using is not doing things right, in this case it is node_modules/.bin/webpack-dev-server and they should have an issue report.

For note, brunch does things right (they have a stdin switch to do just this). You could potentially wrap the webpage-dev-server call in a script like I detailed elsewhere too (that thread has a lot more information about all this as well, but from a general Port perspective, Ports is how Phoenix handles external programs).

3 Likes