Repository navigation
Closed
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 7 x64
- Versions. Please run
ng --version. If there's nothing outputted, please
run in a Terminal:
1.0.0-beta.5 - Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
Created a new app with the CLI. Generated one service. Triedng test. Got this error. - The log given by the failure. Normally this include a stack trace and some
more information.
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: EMFILE: too many open files, open 'c:\Users\rakibler\Projects\efile\tmp\broccoli_type_script_compiler-input_base_path-3mf1JMd2.tmp\0\src\tsconfig.json'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at BroccoliTypeScriptCompiler._loadTsConfig (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:123:34)
at BroccoliTypeScriptCompiler._createServiceHost (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:158:25)
at BroccoliTypeScriptCompiler.build (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:41:12)
at c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:152:21
at lib$rsvp$$internal$$tryCatch (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1198:9)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\broccoli-plugin\index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:21:10)
at BroccoliTypeScriptCompiler (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:27:10)
at Angular2App._getTsTree (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\angular2-app.js:321:18)
at Angular2App._buildTree (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\angular2-app.js:116:23)
at new Angular2App (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\lib\broccoli\angular2-app.js:53:23)
at module.exports (c:\Users\rakibler\Projects\efile\angular-cli-build.js:6:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\lib\models\builder.js:55:19)
at Class.module.exports.Task.extend.init (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\lib\models\builder.js:89:10)
at new Class (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\node_modules\core-object\core-object.js:18:12)
at Class.module.exports.Task.extend.run (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\lib\tasks\build-watch.js:17:16)
at c:\Users\rakibler\Projects\efile\node_modules\angular-cli\addon\ng2\commands\test.js:69:46
at lib$rsvp$$internal$$tryCatch (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (c:\Users\rakibler\Projects\efile\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
Reacted by cjblomqvist, Petar Blazhevski, Egor Komarov, Michael Gerber, Francesco Colamonici, v-terret, Osoian Marcel, Stefan Bley, AionDev, Rajni and 1 more
Metadata
Metadata
Assignees
Labels
No labels
Activity
randyaa commentedon May 20, 2016
I'm running into this same issue. My setup is just about the same except it's not a freshly generated CLI project with a single service. In my case the project is a few months old with approximately 350 spec files and a lot of other code.
cjblomqvist commentedon May 21, 2016
I have the same issue with a newly created project using ng new. I dug a little bit more into the details, and it seems non-trivial to fix. Broccoli is assuming things are running synchronously so it's not trivial to queue up reading certain files (such as using graceful-fs). I've also done significant googling and the issue might be related to broccoli/ember-cli not doing proper cleanup on Windows.
btw. I've tested both with Node 5.x and 6.x. Same issue.
Quick workaround (at least for new projects in my scearnio) is to use --watch false flag or --build false. This works (I believe) since then not so many files are synchronously opened.
maku commentedon May 25, 2016
I have the same problem (Win7 64) when I run tests (ng test).
It works without watching (--watch false)
Project is really small but with material2 dependencies
petarblazevski commentedon May 25, 2016
A workaround is to increase the ulimit:
ulimit -n 1024fixed my problem. But now i have another problem. How do i increase this on Travis CI for example? My builds are failing on this issue from a pull request.alexkibler commentedon May 26, 2016
@maku Yeah, it doesn't error right out for me. However, I get
26 05 2016 14:34:05.769:WARN [Chrome 50.0.2661 (Windows 7 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.EDIT: This seems to just be because of how pitifully slow my work computer is. If I disable the timeout, the tests do run, but they take quite a while.
JSMike commentedon May 26, 2016
hmm, I was trying to solve this by doing a
ng build -prodand then runningng test --path dist/but it's sayingThe option '--path' is not registered with the test command. run 'ng test --helpfor a list of supported optionsbut when I runng test --helpit lists--path` as an option for using a pre-built directory.GaryWenneker commentedon May 29, 2016
@JSMike even running with
doesn't do the trick
Mattek1979 commentedon Jun 2, 2016
I had the same problem, didn't work even with running in elevated. Watching this video: https://www.youtube.com/watch?v=wHZe6gGI5RY&list=PLOETEcp3DkCq788xapkP_OU-78jhTf68j&index=24. I tried running
npm link angular-cliin command window manually and it solved my problems. I'm on a restricted windows 7 machine behind firewall.filipesilva commentedon Jun 2, 2016
I was able to reproduce the EMFILE problem and am tracking it in #977.
The only solution I have at the moment is to separately run
ng serveandng test --build=false.Increasing the file limit via
ulimit -n 1024should work, but that would be necessary in every dev machine of the team, plus CI, which makes it impractical. Will continue looking for a solution.Caroga commentedon Mar 16, 2017
@filipesilva I am curious if you have found anything else ?
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.