Node server crashes on launch of TermKit.app
Followed instructions but getting a crash on launch of the app.
~/src/TermKit/Node(master) $ node nodekit.js 12 May 14:11:49 - socket.io ready - accepting connections 12 May 14:11:54 - Initializing client with transport "websocket" 12 May 14:11:54 - Client 30102237849496305 connected worker: execvp(): No such file or directory
net.js:392
throw new Error('Socket is not writable');
^
Error: Socket is not writable
at Socket._writeOut (net.js:392:11)
at Socket.write (net.js:378:17)
at Object.send (/Users/benr/src/TermKit/Node/shell/shell.js:59:24)
at Object.dispatch (/Users/benr/src/TermKit/Node/shell/shell.js:50:10)
at Object.dispatch (/Users/benr/src/TermKit/Node/router.js:45:13)
at Object.process (/Users/benr/src/TermKit/Shared/protocol.js:57:36)
at Object.receive (/Users/benr/src/TermKit/Shared/protocol.js:128:12)
at [object Object].
Yup, I have the same issue. Sorry I haven't found the solution yet
For the record I am running on the master branch of node:
node -v v0.5.0-pre
Same issue, using node 0.4.7
This error suggests the worker.js subprocess could not be launched (Node/shell/shell.js line 22). Does node exist at /usr/local/bin/node ? You could try console.log()ing the spawned process too and paste it.
I installed node in /usr/local/node so I can easily sandbox it. My bin would be at /usr/local/node/bin/node. I adjusted this file, and got to another error which I also suspect is due to differing paths for my npm install of mime.
Alright - got it working! Issue was changing line 22 of shell.js to the proper node path and installing mime properly.
hmm, my node version is installed in /usr/bin/node, so modifying that line did fix the issue. Isn't it possible to use the 'which' command to locate the node executable?
Or if it ain't possible, an user preference specifying the location of node.js.
Patches are welcome ;).
(though ultimately, the goal is to bundle the appropriate version of node + 3rd party modules transparently with the .app)
Had the same issue. I think the proper way to spawn node is via '/usr/bin/env node' instead of hard-coding /usr/local/bin/node
It also doesn't work with npm 1.0 and the globally-installed mime module. It's probably enough to just update the README to say "run 'npm install mime' from the TermKit/Node directory if you have npm 1.0"
Using '/usr/bin/env node' didn't do it for me, but simply 'node' did. While waiting for everything to be bundled in the app, isn't it safe to assume that the node executable can simply with the PATH variable? (which I think is being used here).