1

Whenever I try to import a project in node.js, I can't seem to get it to work. It gives error's when I try to install. I've tried using cmd, cmd as admin, cmd for node and git bash. They all give the same error and I can't seem to figure out what it means.

This is an example of the output I get when i use "npm install express -g"

c:\wamp\www\3imda\webtech2\eindopdracht>npm install express -g npm WARN unmet dependency C:\Users\Maïteh\AppData\Roaming\npm\node_modules\phone gap\node_modules\phonegap-build requires colors@'0.6.x' but will load npm WARN unmet dependency C:\Users\Maïteh\AppData\Roaming\npm\node_modules\phone gap\node_modules\colors, npm WARN unmet dependency which is version 0.6.0-1 npm WARN unmet dependency C:\Users\Maïteh\AppData\Roaming\npm\node_modules\phone gap\node_modules\prompt\node_modules\winston requires colors@'0.x.x' but will lo ad npm WARN unmet dependency C:\Users\Maïteh\AppData\Roaming\npm\node_modules\phone gap\node_modules\colors, npm WARN unmet dependency which is version 0.6.0-1 npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs \node_modules\npm\bin\npm-cli.js" "install" "express" "-g" npm ERR! node v0.12.0 npm ERR! npm v2.5.1 npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package mongoose does not satisfy its siblings' peerDep endencies requirements! npm ERR! peerinvalid Peer [email protected] wants mongoose@~3

npm ERR! Please include the following file with any support request: npm ERR! c:\wamp\www\3imda\webtech2\eindopdracht\npm-debug.log

c:\wamp\www\3imda\webtech2\eindopdracht>

I get the same error when i try "npm install -g"

6
  • Looks like there's a dependency issue. What does your package.json file look like? Commented Apr 10, 2015 at 19:46
  • this is the package.json file's content gyazo.com/d74d4ac47eeb4c0684a5869346ae4a95 Commented Apr 10, 2015 at 21:33
  • Thanks, I'll see if I can reproduce this. In the meantime, you might try installing without the -g flag. Here's when you should use it. If that doesn't work, could you also upload the npm-debug.log to see if there is any more information we can use in there? Thanks! Commented Apr 10, 2015 at 21:55
  • Thank you very much for your help. When i leave the "-g" the express installs but when i use "npm install", whitch should install alle the modules ? it stil gives an error gyazo.com/5e44f057ec6e807ecc91f05018eca9e4 Where can I upload the debug log? Commented Apr 10, 2015 at 22:02
  • No need, that screenshot was exactly what I needed. Check out my answer and let me know that this solved your issue. Commented Apr 10, 2015 at 22:12

1 Answer 1

2

From this screenshot, you can see that node-restful expects a mongoose of version ~3, but from this screenshot, you can see that you have version 4.0.1 of mongoose! The immediate solution is to change the version of mongoose in the package.json file to 3.9.7 and re-run npm install (without the -g). This is what worked for me locally.

You can read more about Peer Dependencies, should you like to know why this was happening.

Cheers, Brennan

Sign up to request clarification or add additional context in comments.

6 Comments

Yess it worked !! Thank you soo much !! Will this change give problems for my co-worker when I push it to git ?
Glad I could help. It shouldn't give them issues. It's likely they just haven't run npm install in a while and if they were to try it, they would see the same issue. If you feel this solved your question, please accept my answer! I'm here if you have any follow up questions though.
oh, looks like I still can't run the app :s. And nodemon must be installed with "-g" ? But then I still get an error
Nodemon is one of the ones that must be installed with -g. What if you run npm install -g nodemon?
It's possible that there's some issues from installing some of these node_modules in the global context. Try running npm uninstall -g mongoose and npm uninstall -g node-restful, then try installing nodemon with npm install -g nodemon
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.