我试图在角发生器中使用Yeoman来启动一个新的应用程序。
我运行这个命令(根据文档)来启动一个新应用程序:
yo angular my-app-name
所有依赖项都已下载,如果我运行
grunt serve
我的基本应用程序出现在浏览器中,一切看起来都很好。当我试图运行时,问题就开始了:
grunt test
我收到一个错误:Warning: Task "karma" not found. Use --force to continue.
所以我增加了这一行:
"grunt-karma": "*",
"generator-karma": "*"在我的packeage.json文件中,删除node_modules文件夹并运行`npm install。我本来想解决这个问题,但现在我发现了一个错误:
loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'socket.io-client'
Warning: Task "karma" not found. Use --force to continue.
Aborted due to warnings.我尝试过搜索一些,但我找不到任何关于。我正在运行MacOsX 10.8.5和节点v0.10.0。有什么建议吗?
提前感谢
发布于 2015-01-01 21:18:55
yeoman发行版(2014年12月)错过了js库文件,因为测试中的karma.conf.is指向bower_components,这可能是错误的。更改karma.conf.is文件并将bower_components替换为node_modules。
https://stackoverflow.com/questions/21850323
复制相似问题