1

我正在尝试对我的 Angular 项目进行业力测试。我使用 yeoman 创建了 angular 项目。但是,当我尝试运行测试时,出现以下错误

grunt test
Running "clean:server" (clean) task

Running "concurrent:test" (concurrent) task

Running "coffee:dist" (coffee) task

Running "coffee:test" (coffee) task

Done, without errors.

Running "connect:test" (connect) task
Started connect web server on localhost:9000.

Running "karma:unit" (karma) task
INFO [karma]: Karma server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
WARN [watcher]: Pattern "/home/arpit/proj/proj1/views/test/mock/**/*.js" does not  
match any file.
ERROR [launcher]: Cannot start Chrome
Error: spawn EACCES
INFO [launcher]: Trying to start Chrome again.
ERROR [launcher]: Cannot start Chrome
Error: spawn EACCES

INFO [launcher]: Trying to start Chrome again.
ERROR [launcher]: Cannot start Chrome
Error: spawn EACCES
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

我可以使用我尝试运行 grunt test 的同一帐户成功地从 bash 运行 chrome 此外,sudo grunt test 运行良好。

4

3 回答 3

3

在 Mac 上,设置CHROME_CANARY_BIN 为二进制文件很重要,而不仅仅是应用程序包。

在我的情况下,通过安装 Chrome 出现问题brew cask,所以我必须设置

export CHROME_CANARY_BIN="/opt/homebrew-cask/Caskroom/google-chrome-canary/latest/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"

于 2013-09-05T07:19:14.660 回答
1

Mac 10.7.5

我能够使用以下设置它

导出 CHROME_BIN=/Applications/Chrome.app/Contents/MacOS/Google\ Chrome

您可以通过右键单击 .app 并选择 Show Package Contents 选项来访问 exec 文件。按照这个向下到可执行文件并单击它。它在终端中提出了路径。

于 2013-10-23T02:25:27.727 回答
1

在大多数情况下,您必须设置一个环境变量“CHROME_BIN”以指向您的 chrome.exe

视窗:

set CHROME_BIN=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
于 2013-08-19T08:27:59.457 回答