-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
"Error: EMFILE: too many open files, open.." on Windows #59
Comments
I have a same problem. |
This is tricky, because node-glob no longer uses graceful-fs and just including it before node-glob won't work because graceful-fs has stopped monkey-patching fs. The graceful-fs docs say not to patch fs in a library (like this one), so it'd have to be added as an option. The problem is, the option would have to be checked before any other module loaded fs. An environment variable is the only reasonable way I can think to do that, which seems sloppy. If you're running into this issue, you'll need to monkey-patch fs yourself. Here's how:
I'd add this info to the docs. |
The irony of me suggesting graceful-fs based on comments I real elsewhere for different issues and then never looking at the module myself and seeing that it would help :) |
No worries! Others had the same issue, so I'm glad it's in the docs now. |
@kevlened i have same issues,i already monkey-patch fs,below is my code:
error msg:
|
+1 |
@kb3eua I use gulp to copy file. |
@keyiis I didn't want to introduce another task runner. I was able to get it working by upgrading to the latest version of this plugin and using the following configuration to ignore certain files:
|
Having the same error on Windows with many files (Angular 2 CLI Webpack require("async").forEach(Object.keys(compilation.assets), function(file, callback) { Workaround: I don't understand webpack/copy-webpack-plugin/graceful-fs well enough to suggest the right way of fixing this, but constraining webpack to a reasonable number of async operations (using require("async").forEachLimit(Object.keys(compilation.assets), 2000,
require("async").ensureAsync(function(file, callback) { EDIT: Wrapped callback with |
having this issue on OSX (patch applied and all) |
This is still very much an issue, the monkey patch does not work. Ive looked into it, but am still clueless as to a fix. To add a bit more detail, this is the exact error Im getting. I have add issues across Windows, OSX and Linux.
Worst of all, I simply doe a cp before or after webpack runs, it appears my build doesn't pick up the folder, so thats not a solution for me unfortunately. |
@tallaxes path does work, although I needed a much lower limit (100). Patching WebPack itself also isn't ideal. The file that needs to be patched is ./node_modules/webpack/lib/Compiler.js. Thanks @tallaxes, Im still looking for a more elegant solution though. I doubt Webpack themselves will accept a PR when the number is variable. |
@McPo Webpack: It is still worth bringing it to their attention, I think. And there could be ways of coming up with a reasonable number, or just making it configurable. 100 seems unreasonably low; wonder what would limit it like that... For OSX/Linux: did you check OS-level file descriptor limits (i.e. |
@tallaxes done. Ive bumped it back up to 1000 it works fine. I suppose my machine is under heavy load, having said that, lowering it to 100 had no adverse effect on the build time. |
My issues looks like the floder has symlink,resulting in a circular dependency,but I'm not sure. |
Ive created a PR. for those suffering from this issue you can use it right away by setting your package.json to "webpack": "McPo/webpack#1.13.2-file-limit" Ive limited to 1000, but perhaps 500 is more reasonable. |
The upcoming version of copy-webpack-plugin (currently in master) avoids For additional control, I've added a concurrency option that will allow changing how many files the plugin attempts to read at once (currently set to a default of 1000, but it sounds like that should be reduced). Does 100 sound like a reasonable default? |
This should be fixed in the latest version (v4.0.0). We avoid |
still get this error on 4.0.1 |
I upgraded to Node 8 and the EMFILE error went away. |
This error can be due to a configuration file error or a parameter filling error while configuring webpack |
I'm running into this problem with webpack 4.4.1 and node 10.5 |
It started to fail suddenly with: ``` (...) ERROR in EMFILE: too many open files, open 'D:\a\awala-gateway-desktop\awala-gateway-desktop\packages\ui\node_modules\daemon\node_modules\date-fns\fp\isExists\index.js.flow' ERROR in EMFILE: too many open files, open 'D:\a\awala-gateway-desktop\awala-gateway-desktop\packages\ui\node_modules\daemon\node_modules\ajv\lib\dotjs\const.js' webpack 5.73.0 compiled with 7460 errors in 190046 ms ``` The culprit was webpack-contrib/copy-webpack-plugin#59
That's pretty much the issue.
Works fine on OS X
Have googled and can't find any way to increase Windows open file limit.
Is now also happening on OS X 'ENFILE: file table overflow'
As far as I can tell this module always works down to an individual file level in async.
I've worked around this by changing the app structure (it will be the ~8000 files in node_modules) and doing a shell cp instead.
Is it something you need to look at handling via something like graceful-fs?
The text was updated successfully, but these errors were encountered: