1

I followed the CoffeeScript installation guide by installing Node.js with the node-v0.10.9-x64.msi installer. I then started up a cygwin console and cd'd into the directory with my .coffee file. If I type coffee all by itself, it gives me this error:

$ coffee
coffee>
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: read ENOTCONN
    at errnoException (net.js:884:11)
    at Socket._read (net.js:389:21)
    at Socket.Readable.read (_stream_readable.js:320:10)
    at Socket.read (net.js:291:43)
    at new Socket (net.js:185:10)
    at process.stdin (node.js:660:19)
    at new REPLServer (repl.js:132:15)
    at Object.exports.start (repl.js:312:14)
    at Object.module.exports.start (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\repl.js:106:23)
    at Object.exports.run (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:77:32)
    at Object.<anonymous> (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\bin\coffee:7:41)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

And if I run the command with -lw it gives me this error:

$ coffee -lw Example.js.coffee
Error: This socket is closed.
    at Socket._write (net.js:618:19)
    at doWrite (_stream_writable.js:219:10)
    at writeOrBuffer (_stream_writable.js:209:5)
    at Socket.Writable.write (_stream_writable.js:180:11)
    at Socket.write (net.js:596:40)
    at lint (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:468:15)
    at compileScript (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:193:18)
    at C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:144:18
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

And if I run with just the -l option it gives me this error:

$ coffee -l Example.coffee
Error: This socket is closed.
    at Socket._write (net.js:618:19)
    at doWrite (_stream_writable.js:219:10)
    at writeOrBuffer (_stream_writable.js:209:5)
    at Socket.Writable.write (_stream_writable.js:180:11)
    at Socket.write (net.js:596:40)
    at lint (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:468:15)
    at compileScript (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:193:18)
    at C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:144:18
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

But it seems like I can compile and/or watch option without the lint option and things work as expected.

I don't know anything about Node.js. I've tried googling these errors and I see similar ones related to ports in use and socket issues. I think it might be useful to note that I'm using Intellij IDEA (an IDE) and it has a CoffeeScript plugin which perhaps is interfering. But when I turn Intellij off I still get these same errors so that might be a red herring.

Also, perhaps there's a specific cygwin version of node.js I should have installed instead of the one I got from the installation instructions?

If I type node all by itself, it says this:

$ node

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: read ENOTCONN
    at errnoException (net.js:884:11)
    at Socket._read (net.js:389:21)
    at Socket.Readable.read (_stream_readable.js:320:10)
    at Socket.read (net.js:291:43)
    at new Socket (net.js:185:10)
    at process.stdin (node.js:660:19)
    at startup (node.js:145:16)
    at node.js:901:3
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356

1 Answers1

1

Unfortunately, node no longer supports Cygwin.

One workaround is to use some variety of MSysGit as a console instead of Cygwin, at least for running node/coffeescript. Git Bash supplies a good one. You can get it here.

Jon Carter
  • 2,836
  • 1
  • 20
  • 26