piku / sample-nodejs-app

Sample NodeJS app for deployment with piku
MIT License
4 stars 1 forks source link

Document the need for merging stderr #2

Open rcarmo opened 5 years ago

rcarmo commented 5 years ago

The Procfile currently invokes Node by merging stderr and stdout and piping the result through cat:

web: ./index.js 2>&1 | cat

This should be added to the Piku docs someplace, since

a) I can't (yet) find a uwsgi setting for properly handling subprocess stderr in a way that this goes away (which would be ideal) b) It's likely to be necessary for more binaries

looping @chr15m for commentary.

chr15m commented 5 years ago

I found that setting NODE_VERSION to the latest LTS release fixed this and then you don't have to do that cat trick any more.

I also tried fiddling with a bunch of uwsgi settings but couldn't get anytging to work, and I think it's actually to do with the way old node binaries handle stdin rather than stdout (which is fixed by piping).

Anyway, I think the solution is to document this hack for older versions of node, and suggest people use LTS node.