3

I have cleaned my run npm remove ... and npm -g remove ... to remove everything related to npm. But I still got below error when I try npm install generator-webapp

npm ERR! peerinvalid The package yo does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer generator-mocha@0.1.6 wants yo@>=1.0.0
npm ERR! peerinvalid Peer generator-webapp@0.5.1 wants yo@>=1.2.0

Any idea how to fix it? I searched for a while, and the only suggestion is to clean my npm packages.

David S.
  • 181
  • 11

2 Answers2

4

I just ran up against the same problem and after some random kicks and punches, was able to get things working.

Step 1: Remove Yeoman

$ npm uninstall -g yo

Step 2: Clear NPM Cache

$ npm cache clean

Step 3: Upgrade NPM to latest version

$ npm install -g npm

Step 4: Install Yeoman

$ npm install -g yo

After doing this, things kicked into life. I saw the exact same error so I am confident this will work for you. Also, not sure but step 2 may be optional.

Hope this helps, let me know if you hit any other snags!

1

The problem is not in the npm packages. It is the npm itself. The npm in Ubuntu repository is too old. Use this guide to install the latest one, and everything works.

David S.
  • 181
  • 11
  • How does this piece of advice differ from that offered by BlakePetersen? (3 - upgrade NPM to latest version)? – Deer Hunter Oct 31 '14 at 23:38
  • I tried. I cannot upgrade npm with npm...can you? – David S. Nov 01 '14 at 03:17
  • @davidshen84 Be sure you are using "install" instead of "update" to update npm to the latest version. Attempting to update it like a standard package doesn't work. https://www.npmjs.org/doc/misc/npm-faq.html#how-do-i-update-npm- – BlakePetersen Nov 03 '14 at 20:34