Windows 10 Pro
Node 10.14.1
npm 6.4.1
Angular 7.2.15
Angular CLI 7.3.9
$ npm install karma --save-dev
$ npm install karma-firefox-launcher --save-dev
$ ng test
17 09 2019 13:08:47.472:WARN [karma]: No captured browser, open http://localhost:9876/
17 09 2019 13:08:47.499:INFO [karma-server]: Karma v4.3.0 server started at http://0.0.0.0:9876/
17 09 2019 13:08:47.499:INFO [launcher]: Launching browsers Firefox with concurrency unlimited
17 09 2019 13:08:47.512:INFO [launcher]: Starting browser Firefox
17 09 2019 13:08:47.821:ERROR [launcher]: Cannot start Firefox
17 09 2019 13:08:47.821:ERROR [launcher]: Firefox stdout:
17 09 2019 13:08:47.821:ERROR [launcher]: Firefox stderr:
17 09 2019 13:08:53.544:INFO [launcher]: Trying to start Firefox again (1/2).
17 09 2019 13:08:53.545:WARN [temp-dir]: Failed to create a temp dir at C:\Users\myuser\AppData\Local\Temp\2\karma-77822405
17 09 2019 13:08:59.446:ERROR [launcher]: Cannot start Firefox
17 09 2019 13:08:59.446:ERROR [launcher]: Firefox stdout:
17 09 2019 13:08:59.446:ERROR [launcher]: Firefox stderr:
17 09 2019 13:09:00.645:WARN [karma]: No captured browser, open http://localhost:9876/
17 09 2019 13:09:02.550:INFO [Firefox 68.0.0 (Windows 10.0.0)]: Connected on socket Q7q0OTZs2xJ4M7E9AAAA with id 77822405
Firefox 68.0.0 (Windows 10.0.0): Executed 44 of 44 SUCCESS (0.312 secs / 0.267 secs)
TOTAL: 44 SUCCESS
TOTAL: 44 SUCCESS
17 09 2019 13:09:04.765:INFO [launcher]: Trying to start Firefox again (2/2).
17 09 2019 13:09:04.766:WARN [temp-dir]: Failed to create a temp dir at C:\Users\myuser\AppData\Local\Temp\2\karma-77822405
17 09 2019 13:09:10.043:ERROR [launcher]: Cannot start Firefox
17 09 2019 13:09:10.043:ERROR [launcher]: Firefox stdout:
17 09 2019 13:09:10.043:ERROR [launcher]: Firefox stderr:
17 09 2019 13:09:13.175:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.
请注意,我可以手动打开Firefox浏览器。
还请注意,在cmd.exe
或git-bash.exe
中,我可以转到此目录并创建子目录temp