运行npm install时的mocha&chai依赖项

前端之家收集整理的这篇文章主要介绍了运行npm install时的mocha&chai依赖项前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想用Grunt(Yeoman Ionic)运行Ionic应用程序
为此,脚本运行npm install和bower install.然后运行grunt进行编译,然后grunt serve在本地主机上提供服务.

npm install不会与Mocha和Chai创建对等依赖关系,这使得bower安装中止如下:

Running "karma:continuous" (karma) task
Warning: Cannot find module 'mocha' Use --force to continue.

Aborted due to warnings.

我运行npm install -g chai mocha然后npm install并得到了相同的结果

npm WARN karma-mocha@0.1.10 requires a peer of mocha@* but none was installed.
npm WARN karma-chai@0.1.0 requires a peer of chai@* but none was installed.

即使这是一个警告,它在运行yo ionic时会产生错误

npm WARN karma-chai@0.1.0 requires a peer of chai@* but none was installed.
npm WARN karma-mocha@0.1.10 requires a peer of mocha@* but none was installed.
ERROR: Error: ENOENT: no such file or directory,rename '/Users/donjohnson/ionicNom/app/app/css' -> '/Users/donjohnson/ionicNom/app/app/styles'
ERROR: Error: ENOENT: no such file or directory,rename '/Users/donjohnson/ionicNom/app/app/js' -> '/Users/donjohnson/ionicNom/app/app/scripts'
ERROR: Error: ENOENT: no such file or directory,rename '/Users/donjohnson/ionicNom/app/app/img' -> '/Users/donjohnson/ionicNom/app/app/images'

这使得grunt服务打开一个浏览器页面,里面没有任何东西:(

解决方法

npm install –save-dev mocha chai到你的项目(没有-g).

从版本3开始,npm不会自动安装peerDependencies

猜你在找的设计模式相关文章