Steps to Reproduce:
yarn to install all dependencies.gulp vscode-linux-x64 or gulp vscode-linux-x64-min
Does this issue occur when all extensions are disabled?: N/A
The issue occurs after Starting 'vscode-linux-x64'... is shown. The actual error message is:
events.js:165
throw er; // Unhandled 'error' event
^
Error: EMFILE: too many open files, open '/home/mjg/Downloads/vscode-1.22.1/extensions/json-language-features/node_modules/applicationinsights/out/AutoCollection/diagnostic-channel/postgres.sub.js'
Emitted 'error' event at:
at fs.js:2066:12
at FSReqWrap.oncomplete (fs.js:153:20)
The issue has been reproduced among both my Arch Linux machines. Another issue was seen with the machine of the package maintainer for this repository on the Arch Linux User Repository:
[10:08:12] Finished 'optimize-vscode' after 22 s
[10:08:12] Starting 'vscode-linux-x64'...
internal/streams/legacy.js:57
throw er; // Unhandled stream error in pipe.
^
Error: connect ECONNRESET 13.107.6.175:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
The issue can be reproduced on version 1.22.0 as well.
A similar issue can be reproduced on release/1.21, Win 7, when packaging the json extension.
This is a node issue: https://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files
It seems a bit odd to dismiss this as a node issue when 1.21 builds fine with a file ulimit of only 1024 files, but I needed close to 10K open files for building 1.22... Nonetheless, 1.22.1 does build with the higher limit.
I鈥檓 facing this same issue, and it鈥檚 happening statring from 1.22.0. It builds just fine on 1.21.1. As said @zrax, VSCode is somehow responsible (or its dependencies, and therefore, itself) to handle this.
[鈥
events.js:165
throw er; // Unhandled 'error' event
^
Error: EMFILE: too many open files, open '/home/myself/workspace/sandbox/vscode-1.22.0/extensions/json-language-features/node_modules/applicationinsights/out/AutoCollection/diagnostic-chanevents.js:165
nel/postgres.sub.d.ts'
Emitted 'error' event at:
at fs.js:2066:12
at FSReqWrap.oncomplete (fs.js:153:20) throw er; // Unhandled 'error' event
^
Error: EMFILE: too many open files, open '/home/myself/workspace/sandbox/vscode-1.22.0/extensions/json-language-features/node_modules/applicationinsights/out/AutoCollection/diagnostic-channel/postgres.sub.d.ts'
Emitted 'error' event at:
at fs.js:2066:12
at FSReqWrap.oncomplete (fs.js:153:20)
This is not a Node issue, but an OS setting. Just increase your file limits.
https://wiki.archlinux.org/index.php/Limits.conf
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
Well I'm way more inclined to think this actually is a NodeJS issue, which happens to be "workaround-able" by changing the OS configuration, but this is not the place to discuss that.
So, for anyone interested in the workaround, I'm providing steps on how to increase the max open files limit on Linux+systemd at https://superuser.com/a/1322187/358758.
Most helpful comment
It seems a bit odd to dismiss this as a node issue when 1.21 builds fine with a file ulimit of only 1024 files, but I needed close to 10K open files for building 1.22... Nonetheless, 1.22.1 does build with the higher limit.