我通过运行
使用Yeoman生成了一个AngularJS项目然后我跑了yo Angular myProjectName
咕噜
构建项目。但是由于警告,构建得到了挫折:
Deans-MacBook-Air:frontend dean$ grunt
Running "newer:jshint" (newer) task
Running "newer:jshint:all" (newer) task
Running "jshint:all" (jshint) task
✔ No problems
Running "newer-postrun:jshint:all:1:/Users/dean/Desktop/myProjectName/frontend/node_modules/grunt-newer/.cache" (newer-postrun) task
Running "newer:jshint:test" (newer) task
No newer files to process.
Warning: Task "karma" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2014-07-18 07:37:37 UTC)
loading tasks 3ms ▇ 3%
newer:jshint 3ms ▇ 3%
newer:jshint:all 6ms ▇▇ 6%
jshint:all 75ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 79%
newer-postrun:...-newer/.cache 1ms ▇ 1%
newer:jshint:test 5ms ▇▇ 5%
Total 95ms
Deans-MacBook-Air:frontend dean$
所以是的......我试过了
npm install -g generator-karma
然后在安装后重新启动终端,但这也无效。我正在使用运行OSX 10.9.4 fyi的macbook。
答案 0 :(得分:6)
sudo npm install grunt-karma --save-dev
答案 1 :(得分:1)
我工作的唯一解决方案是:
sudo npm install grunt-karma karma karma-phantomjs-launcher karma-jasmine jasmine-core phantomjs-prebuilt --save-dev
咕噜声测试 或者:咕噜叫,这是工作!