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

Chokidar not working on windows 10 #1222

Closed
6ATBA opened this issue Jun 8, 2022 · 4 comments
Closed

Chokidar not working on windows 10 #1222

6ATBA opened this issue Jun 8, 2022 · 4 comments
Labels

Comments

@6ATBA
Copy link

6ATBA commented Jun 8, 2022

Describe the bug

Chokidar not working on windows.

Versions (please complete the following information):

  • Chokidar version: 3.5.3
  • Node version: 16.13.2, 18.3.0
  • OS version: MacOS 10.15.7, Windows 10 (build 19043.1706)

To Reproduce:

  1. Make test.js
const { watch } = require('chokidar');

const watcher = watch(".");
watcher.on('ready', () => console.log('Watching dir...'));
watcher.on('change', path => console.log(`File ${path} has been changed`));
  1. Run "test.js"
  2. See error below
node:internal/errors:466
    ErrorCaptureStackTrace(err);
    ^

Error: EISDIR: illegal operation on a directory, watch '.'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2306:34)
    at createFsWatchInstance (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:119:15)
    at setFsWatchListener (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:166:15)
    at NodeFsHandler._watchWithNodeFs (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:331:14)
    at NodeFsHandler._handleDir (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:567:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NodeFsHandler._addToNodeFs (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:617:16)
    at async Y:\pdf\node_modules\chokidar\index.js:451:21
    at async Promise.all (index 0)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (Y:\pdf\node_modules\chokidar\index.js:647:10)
    at NodeFsHandler._addToNodeFs (Y:\pdf\node_modules\chokidar\lib\nodefs-handler.js:645:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Y:\pdf\node_modules\chokidar\index.js:451:21
    at async Promise.all (index 0) {
  errno: -4068,
  syscall: 'watch',
  code: 'EISDIR',
  path: '.',
  filename: '.'
}

Expected behavior
The script should work without errors like on MacOS.

@paulmillr paulmillr added the win32 label Jul 1, 2022
@mohghaderi
Copy link

@6ATBA Could it be a permission issue on NTFS or a network drive?

@rayhu
Copy link

rayhu commented Feb 16, 2023

I cannot reproduce the error. The Y: drive may be a mapped network drive.

@6ATBA
Copy link
Author

6ATBA commented Oct 11, 2023

The problem was in the network drive, indeed.

@6ATBA 6ATBA closed this as completed Oct 11, 2023
@itsdouges
Copy link

What was the solution since it was a network drive? I'm also getting these errors in by users of triplex.dev in Windows. Vite has a similar problem here: vitejs/vite#13655 that was resolved by a try catch. Is Chokidar doing something similar?

image

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

No branches or pull requests

5 participants