I have a virtual box with windows 10 installed on it, I added the folder which contains my React app to virtual box shared folders, after that I went inside the virtual box and mounted the shared folder as a drive, now after I open the React app project with vs code inside my virtual box and in the terminal I type
npm start
I get the error :
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Starting the development server...
node:events:356
throw er; // Unhandled 'error' event
^
Error: EISDIR: illegal operation on a directory, watch 'Z:\myReactApp\public'
at FSWatcher.<computed> (node:internal/fs/watchers:219:26)
at Object.watch (node:fs:1572:34)
at createFsWatchInstance (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:38:15)
at setFsWatchListener (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleDir (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:429:19)
at FSWatcher.<anonymous> (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:477:19)
at FSWatcher.<anonymous> (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:482:16)
at FSReqCallback.oncomplete (node:fs:195:5)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\index.js:260:10)
at createFsWatchInstance (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:40:5)
at setFsWatchListener (Z:\myReactApp\node_modules\webpack-dev-server\node_modules\chokidar\lib\nodefs-handler.js:81:15)
[... lines matching original stack trace ...]
at FSReqCallback.oncomplete (node:fs:195:5) {
errno: -4068,
syscall: 'watch',
code: 'EISDIR',
path: 'Z:\\myReactApp\\public',
filename: 'Z:\\myReactApp\\public'
}
npm ERR! code 1
npm ERR! path Z:\myReactApp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c react-scripts start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AA\AppData\Local\npm-cache\_logs\2021-01-20T15_32_54_716Z-debug.log
Why is this error happening and how can I solve it?