安装 NodeJs, npm.node
环境变量配置.git
1, Gruntgithub
安装 : chrome
npm install -g grunt-cli
npm install -g grunt
package.jsonnpm
{ "name": "my-project-name", "version": "0.1.0", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-nodeunit": "~0.4.1", "grunt-contrib-uglify": "~0.5.0" } }
使用Grunt 进行 Karma 测试任务是出现 json
Please set env variable CHROME_BIN 错误时grunt
在命令行输入 测试
SET CHROME_BIN=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
设置临时环境变量或添加 CHROME_BIN 到 系统环境变量中去便可解决.(有一些状况下, 添加系统环境变量后没有当即生效, 从新打开命令行/注销系统重启能够解决.)
引用: http://stackoverflow.com/questions/16017896/setting-environment-variable-for-chrome-bin-does-not-workspa
http://stackoverflow.com/questions/18924263/how-to-fix-error-please-set-env-variable-chrome-bin-when-running-angular-js-wi命令行
https://github.com/karma-runner/karma/blob/master/docs/config/03-browsers.md#correct-path-to-browser-binary
http://gruntjs.com/
2, Karma