-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
fs incorrectly handles mapped network drive on Windows #8823
Comments
That is probably unfixable. The documentation comments on it:
|
Is there any way to make this behaviour customizable (e.g. not throw irrelevant exception)? I have no control over the caller (the call happens in karma and due to this I can't run any karma tests on a virtual machine). |
Node.js just forwards the error that the operating system reports. You probably need to take this up with karma. |
Thank you! For anyone who gets here from google in the future, here's a simple way to resolve the issue, add: |
Is there any update regarding the feasability of a fix for this one? Cheers ✨ |
This is very similar to #6861 where various fs functions erroneously consider files on a mapped network drive to be directories, however this time fs.watch demonstrates this behavior on the (currently) latest version of node:
Easiest way to reproduce is to run the following file:
// test.js
var fs = require ("fs");
fs.watch(__filename);
If executed in C:\Temp, fs.watch is executed normally (starts watching):
C:\Temp> node test.js
^C
C:\Temp>
If executed in a mapped network drive, for example X:\Temp:
X:\Temp> node test.js
fs.js:1236
throw error;
^
Error: watch X:\Temp\test.js EISDIR
at exports._errnoException (util.js:907:11)
at FSWatcher.start (fs.js:1234 :19)
at Object.fs.watch (fs.js:1262:11)
at Object. (X:\Temp\test.js:2:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
X:\Temp>
Note that many people run into this issue because of using virtual machines, for example VirtualBox provides shared directories with the host as a mapped network drive, so it's impossible to run any node code (that uses fs functions) on a mapped host directory due to it being a network drive.
This happens on node 4.0.0 and on the latest 6.7.0.
The text was updated successfully, but these errors were encountered: