当前位置 : 主页 > 手机开发 > 其它 >

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

来源:互联网 收集:自由互联 发布时间:2021-06-22
我想用Grunt(Yeoman Ionic)运行Ionic应用程序 为此,脚本运行npm install和bower install.然后运行grunt进行编译,然后grunt serve在本地主机上提供服务. 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

网友评论