3

Noticed Karma tests not running on a new angular-cli project

  1. ng new MyProject
  2. Let project build
  3. npm run test
  4. The following is output, and a blank browser is opened to (localhost:9876/?id=50029001). The page is identified as 'Untitled'.

    10% building modules 1/1 modules 0 active06 11 2017 13:15:08.477:WARN [karma]: No captured browser, open http://lo calhost:9876/ 06 11 2017 13:15:08.493:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/ 06 11 2017 13:15:08.493:INFO [launcher]: Launching browser Chrome with unlimited concurrency 06 11 2017 13:15:08.493:INFO [launcher]: Starting browser Chrome 06 11 2017 13:15:22.195:WARN [karma]: No c aptured browser, open http://localhost:9876/ 06 11 2017 13:16:08.507:WARN [launcher]: Chrome have not captured in 60000 ms, killing. 06 11 2017 13:16:08.601:INFO [launcher]: Trying to start Chrome again (1/2). 06 11 2017 13:17:08.618:WARN [launcher]: Chrome have not captured in 60000 ms, killing. 06 11 2017 13:17:08.758:INFO [launcher]: Trying to start Chrome again (2/2). 06 11 2017 13:18:08.774:WARN [launcher]: Chrome have not captured in 60000 ms, killing. 06 11 2017 13:18:08.960:ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.

Is this a new break with the release of Angular-5?

2 Answers 2

1

Although you write that you did a new project, so npm install is done with no node_modules folder existing before, I want to share my solution in case someone gets to this thread like I did. I had the same problem and tried a lot of the suggested solutions I found, but what finally solved it for me was to delete the node_modules folder and getting everything new via npm install.

same issue: Karma - Chrome failed 2 times (cannot start). Giving up

Sign up to request clarification or add additional context in comments.

Comments

0

go to the same directory as karma.conf.js and run the command "karma start"

3 Comments

Running 'karma start' provides the following response: karma : The term 'karma' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + karma start + ~~~~~ + CategoryInfo : ObjectNotFound: (karma:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
install it : npm install -g karma-cli
A search on the karma error found this link (stackoverflow.com/questions/20800933/…) The fix is to run 'npm install karma-cli'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.