我想用Grunt(Yeoman Ionic)运行一个Ionic应用程序.为此,脚本运行npm install
并且bower install
.然后运行grunt
编译,然后grunt serve
在本地主机上提供它.
npm install
不会像Mocha和Chai那样创建对等依赖项,因为它会bower install
像这样中止:
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