ng 测试 - Chrome 没有在 60000 毫秒内捕获,杀死

ng test - Chrome have not captured in 60000 ms, killing

删除项目中的所有 *.component.spec.ts 文件后,ng 测试停止工作。

输入 ng test 后,这些是日志:

$ ng test
⠋ Generating browser application bundles...07 05 2021 16:06:36.095:WARN [karma]: No captured browser, open http://localhost:9876/
07 05 2021 16:06:36.099:INFO [karma-server]: Karma v5.2.3 server started at http://localhost:9876/
07 05 2021 16:06:36.099:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
07 05 2021 16:06:36.102:INFO [launcher]: Starting browse✔ Browser application bundle generation complete.07 05 2021 16:06:49.628:WARN [karma]: No captured browser, open http://localhost:9876/
07 05 2021 16:07:36.103:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
07 05 2021 16:07:36.133:INFO [launcher]: Trying to start Chrome again (1/2).
07 05 2021 16:08:36.134:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
07 05 2021 16:08:36.161:INFO [launcher]: Trying to start Chrome again (2/2).
07 05 2021 16:09:36.162:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
07 05 2021 16:09:36.189:ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.

尝试过的东西:

注意事项:

版本

输入 ng update 并用 ng update --force @angular/core 更新 @angular/core 后,测试再次开始在 Chrome 上运行。

这可能是特定@angular/core 版本 (v11.1.1) 或我的 Angular 包版本不匹配的问题。

(我把它留在这里是为了帮助其他有同样问题的人。)