简体   繁体   English

无法以角度启动业力服务器

[英]Can't start the karma server in angular

Hi I'm trying to get the test script running on the angular tutorial (step 2, writing and running test part 1) but I'm stuck at trying to run the karma server but when I run the command in the GitBash terminal I get this error 嗨,我试图在角度教程上运行测试脚本(第2步,编写和运行测试第1部分),但是我一直想尝试运行业力服务器,但是当我在GitBash终端中运行命令时,这个错误

John@JOHN-PC ~/angular-phonecat ((step-2))
$ ./scripts/test.sh

Starting Karma Server (http://karma-runner.github.io)
-------------------------------------------------------------------
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [launcher]: Cannot start Chrome
    Can not find the binary C:\Users\John\AppData\Local\Google\Chrome\Applic
ation\chrome.exe
    Please set env variable CHROME_BIN

any idea what this means 知道这意味着什么

here's the link to the tutorial http://docs.angularjs.org/tutorial/step_02 这是教程http://docs.angularjs.org/tutorial/step_02的链接

As Cristian Ternus had already pointed out you will have to set the correct value of the CHROME_BIN env variable. 正如Cristian Ternus指出的那样,您将必须设置CHROME_BIN env变量的正确值。 Dont copy the path as it is provided in the comment. 不要复制注释中提供的路径。 You will have to find out where crome.exe is present on your machine. 您将必须找出crome.exe在计算机上的何处。 Please refer http://bardevblog.wordpress.com/2013/07/28/setting-up-angularjs-angular-seed-node-js-and-karma/ which is a nice tutorial about running angular test cases. 请参考http://bardevblog.wordpress.com/2013/07/28/setting-up-angularjs-angular-seed-node-js-and-karma/ ,这是有关运行角度测试用例的很好的教程。 Step 8 in the tutorial is addressing your issue. 本教程中的第8步正在解决您的问题。

Do you have Google Chrome installed? 您安装了Google Chrome吗? If not, install it. 如果没有,请安装它。

If it's installed, is it in that path ( C:\\Users\\John\\AppData\\Local\\Google\\Chrome\\Applic ation\\chrome.exe )? 如果已安装,是否在该路径下( C:\\Users\\John\\AppData\\Local\\Google\\Chrome\\Applic ation\\chrome.exe )?

If not, set the environment variable CHROME_BIN to the path of chrome.exe . 如果不是, 请将环境变量 CHROME_BIN 设置chrome.exe的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM