Closed hoschi closed 8 years ago
Exact same problem here. Arch Linux x64.
I have the same issue, but it only appears when I use vim to edit the markdown files. Editing and saving using mousepad doesn't produce the same behaviour. I've seen similar problems with other node apps which watch files for changes. I suspect that Emacs will also be affected, which editor are you using when the issue appears?
Vim writes to a swap file then either renames or switches it out with the actual file when you save it, I couldn't find exact details in the docs. The way it does this confuses or conflicts with many file watching systems in different languages. This was the most similar issue in a javascript project that I could find: https://github.com/arboleya/coffee-toaster/issues/47
I suspect that one of the dependencies which does the file monitoring is either mishandling the file system events produced by the vim save sequence, or the handlers in hexo aren't accounting for this situation (the first is most likely given the E_ISDIR error)
I was indeed using Vim at the time. That explanation makes sense.
I get this error and I am using emacs.
I was having the same issue, editing with Vim on linux.
It looks like hexo-fs's dependencies list chokidar at a very outdated version (0.12). Chokidar is what is responsible for watching the file system and the latest version is 1.0.5.
Not ideal, but I manually bumped the version to 1.0.5 in hexo-fs's package.json and re-installed the module and now watching files works fine without errors.
I followed marrone's suggestion to upgrade chokidar version, and that does fix the problem.
For the sake of completeness, this also happens when using Github's Atom Editor with the Option Back Up Before Saving
enabled.
chokidar was updated back in April. https://github.com/hexojs/hexo-fs/commit/ec8b2527ec1f25bc9e41ebff160f550950997753
Hi,
here is my test workflow:
hexo init test-hexo
cd test-hexo && npm install
hexo server --port 9778
I tried this with node versions 0.10.38 and 0.12.2. I don't know if this is important, but I get warnings during
npm install
, here is the log: