天天看點

yo angular+grunt生成webapp時報錯karma插件沒找到

問題背景:用yeamon生成angular + bootstrap架構的webapp後grunt serve可以正常建構項目,但是運作grunt指令後報錯

jit-grunt: Plugin for the "karma" task not found. 
If you have installed the plugin already, please setting the static mapping.
           

解決辦法:指令行輸入:

npm install grunt-karma karma karma-phantomjs-launcher karma-jasmine jasmine-core phantomjs-prebuilt --save-dev
           

問題完美解決!!!

參考連結:https://github.com/yeoman/generator-angular/issues/1230

由于本人目前經驗不足,問題原因可能是“most probably karma is not installed due to the new npm installation policy”,就是說“”很可能是由于新的npm安裝協定導緻karma木有安裝”。具體詳細解釋等待以後跟進!