Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mocha & chai dependencies when running npm install

I want to run an Ionic app with Grunt (Yeoman Ionic) To do this the script runs npm install and bower install. Then run grunt to compile and then grunt serve to serve it on local host.

npm install does not create peer dependencies with Mocha and Chai which is making bower install abort like so:

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

Aborted due to warnings.

I ran npm install -g chai mocha then npm install and got the same

 npm WARN [email protected] requires a peer of mocha@* but none was installed.
npm WARN [email protected] requires a peer of chai@* but none was installed.

Even though this is a warning it is yielding errors when running yo ionic:

npm WARN [email protected] requires a peer of chai@* but none was installed.
npm WARN [email protected] 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'

This makes grunt serve open a browser page with nothing in it :(

like image 305
ohyeahthatssour Avatar asked Dec 09 '22 00:12

ohyeahthatssour


1 Answers

npm install --save-dev mocha chai to your project (without the -g).

As of version 3, npm does not automatically install peerDependencies

like image 77
thebearingedge Avatar answered Dec 11 '22 08:12

thebearingedge