Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "use fs.watch api instead" using the --watch flag on Windows, Node 0.6.6 #15

Open
jpoehls opened this issue Mar 3, 2012 · 5 comments

Comments

@jpoehls
Copy link

jpoehls commented Mar 3, 2012

I'm on Windows 7 32bit. Node 0.6.6. Up 0.1.7.

When I run my app with up server.js it works fine, but when I add the --watch flag (i.e. up server.js --watch) it fails with the error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: use fs.watch api instead
    at Object.watchFile (fs.js:734:11)
    at C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:237:10
    at Array.forEach (native)
    at watch (C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:236:11)
    at Object.<anonymous> (C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:249:3)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:470:10)
@rauchg
Copy link
Contributor

rauchg commented Mar 3, 2012

Can you upgrade to Node 0.6.12?

@jpoehls
Copy link
Author

jpoehls commented Mar 4, 2012

I upgraded to Node 0.6.12 and then tried again, same error. Here's the error, the stack trace changed slightly with the node upgrade.

  up-cli starting cluster with 2 workers on port 3000
  up-cli `kill -s SIGUSR2 3052` or ctrl + r to load new code
  up spawning 2 workers from master 3052
  up worker 4624 created
  up worker 1136 created
  up-cli watching "C:\hg\canary" for changes

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: use fs.watch api instead
    at Object.watchFile (fs.js:734:11)
    at C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:237:10
    at Array.forEach (native)
    at watch (C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:236:11)
    at Object.<anonymous> (C:\Users\jpoehls\AppData\Roaming\npm\node_modules\up\bin\up:249:3)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)

@rauchg
Copy link
Contributor

rauchg commented Mar 4, 2012

That's really odd. No mention of that here

@jpoehls
Copy link
Author

jpoehls commented Mar 4, 2012

Looks like the CoffeeScript guys hit the same problem. From the looks of the conversation on this thread they ended up using fs.watchFile if it is supported and then falling back to fs.watch when it isn't (i.e. on Windows).

@TooTallNate
Copy link
Contributor

This should work on Windows now on node v0.8.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants