0

error :

+-- UNMET PEER DEPENDENCY generator-backbone-mocha@>=0.0.2 `-- UNMET PEER DEPENDENCY generator-mocha@>=0.1.3

npm WARN generator-backbone@0.4.0 requires a peer of generator-mocha@>=0.1.3 but none was installed. npm WARN generator-backbone@0.4.0 requires a peer of generator-backbone-mocha@>=0.0.2 but none was installed.

SudTheNerd
  • 196
  • 1
  • 1
  • 7
  • Welcome to Stack Overflow! As your question stands it probably isn't a good fit for this site. You can improve your question by editing it to include the steps you've tried to resolve this, since as it is now you've only included error messages. – James Skemp Jan 01 '16 at 17:36

1 Answers1

0

UNMET PEER DEPENDENCY error means that your dependency (in this case generator-backbone) requires that you explicitly install also something else (in this case, generator-mocha and generator-backbone-mocha). You should just install those dependencies (top level):

npm install generator-backbone@0.4.0 --save
npm install generator-backbone-mocha --save
Tomas Kulich
  • 14,388
  • 4
  • 30
  • 35
  • i install generator-mocha and generator-backbone-mocha both globly with -g option, but in 'generator-backbone-mocha' it gives error of unmeet peer dependency of "yo>=1.0 " and i globally install yo. – SudTheNerd Jan 02 '16 at 20:05
  • when i do this "sudo npm install -g generator-backbone-mocha --save" then error : UNMET PEER DEPENDENCY yo@>=1.1.2 npm WARN generator-backbone-mocha@0.1.1 requires a peer of yo@>=1.1.2 but none was installed. – SudTheNerd Jan 02 '16 at 20:58
  • If 'generator-backbone-mocha' peer-depends on 'yo' and 'yo' is installed globally, then yes, the warning will be there, because global packages are not considered as peers. However, since the package is there, the warning should be quite harmless (as long as the globally installed package is in the correct version). If you want to get rid of the warning, you should stop using global dependencies, it is a BAD practice anyway. – Tomas Kulich Jan 02 '16 at 21:04
  • I just noticed another comment; combining '-g' and '--save' in 'npm install' does not make sense - there is no reasonable place, where the dependency should be saved. – Tomas Kulich Jan 02 '16 at 21:07
  • so..how stop using global dependencies ? – SudTheNerd Jan 02 '16 at 21:20
  • Theoretically, you should be fine installing everything locally. If there is some package that wants to be installed globally (so you can use it from command line system-wide) (such as gulp, eslint or yo), good practice is that the globally installed package searches for the local version of itself and delegates the work to it; for example gulp works this way: http://stackoverflow.com/questions/22115400/why-do-we-need-to-install-gulp-globally-and-locally. I'm not sure if yo honor such convention, if not, you can stop using it or just ignore the 'unmet peer dependency' message. – Tomas Kulich Jan 03 '16 at 10:32