jashkenas/coffee-script — Issue #1803: Node:  use fs.watch api instead
Author: tylerwayne
Created: 2011-10-25 07:25:22+00:00
State: open

If this issue has already been reported, I apologize for duplicating it. But I haven't found anything in the CoffeeScript community to indicate that this is known, so I'm going to report it here and hope that I won't get schooled.

Using the latest builds of Node.js for Windows (single .exe files, currently on v0.5.10), I get an error every time I try to tell the compiler to watch and compile my file. Specifically:

```
fs.js:696
throw new Error('use fs.watch api instead');
^
Error: use fs.watch api instead
at Object.watchFile (fs.js:696:11)
at C:\Program Files\CoffeeScript\lib\coffee-script\command.js:199:15
at Object.oncomplete (C:\Program Files\CoffeeScript\lib\coffee-script\comman
d.js:119:52)
```

It appears based on this error (and [this similar issue on node-supervisor](https://github.com/isaacs/node-supervisor/issues/26)) that the fs.watchFile API no longer functions in these latest versions of Node.js.

Whether or not this issue is isolated to my usage on Windows 7, I would be happy to try to rewrite the compiler to use the new API. But if I'm not the only one with this problem, then I probably shouldn't be the one to submit the fix, as I'm not the cleanest programmer out there, and I don't have very much free time since school is in full swing.

With humility,
*Tyler Wayne*