solettaproject / soletta-dev-app

Soletta Development Application
Apache License 2.0
7 stars 13 forks source link

nodejs 4.5 issue #151

Open yongli3 opened 7 years ago

yongli3 commented 7 years ago

With nodejs 4.5, the app crashes and I receive the below error message, nodejs 4.2.6 is okay. Running command sol-fbp-runner -c /opt/soletta-dev-app/repos/singlesession/demo/minnow-calamari/.calamari-lever.fbp stdout: '/opt/soletta-dev-app/repos/singlesession/demo/minnow-calamari/.calamari-lever.fbp' - Syntax OK

closing code: 0 _http_server.js:192 throw new RangeError(Invalid status code: ${statusCode}); ^

RangeError: Invalid status code: 0 at ServerResponse.writeHead (_http_server.js:192:11) at ServerResponse.writeHead (/opt/soletta-dev-app/node_modules/morgan/node_modules/on-headers/index.js:55:19) at ServerResponse._implicitHeader (_http_server.js:157:8) at ServerResponse.OutgoingMessage.end (_http_outgoing.js:573:10) at ServerResponse.send (/opt/soletta-dev-app/node_modules/express/lib/response.js:204:10) at ServerResponse.sendStatus (/opt/soletta-dev-app/node_modules/express/lib/response.js:341:15) at ChildProcess. (/opt/soletta-dev-app/server/routes.js:303:29) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:829:16)

yongli3 commented 7 years ago

A workaround: Modify the node_modules/express/lib/response.js, change return this.send(body); to return this.send(body ? 200 : 500);