browserify / watchify

watch mode for browserify builds
Other
1.79k stars 181 forks source link

Fix EPERM error on Windows on rename #104

Closed manuelcabral closed 10 years ago

manuelcabral commented 10 years ago

Fixes #83 by writing to output file on callback

j201 commented 10 years ago

So what's the problem causing #83? I've been experiencing the bug and I'm anxious to get around it, so I'd like to take a look or help out with it.

manuelcabral commented 10 years ago

The fs.rename() seems to fail because the temporary file is still being used. Perhaps the file is still opened by browserify, but I couldn't find it.

Although this fix (writing directly to the output file) seems to work on Windows it may cause some problems, such as triggering a watch before the file has been completely written. Renaming would definitely be best.