Winnemucca
Winnemucca

Reputation: 3458

Node Restful with mongoose 4

I am attempting to install node-restful with mongoose 4. However, my command line response is

"peerinvalid The package mongoose does not satisfy its  

siblings'peerDependencies requirements!

npm ERR! peerinvalid Peer [email protected] wants mongoose@~3"

Is there a way around this? I am hoping to working with the more recent mongoose version. Thanks!

Upvotes: 1

Views: 980

Answers (2)

Raz
Raz

Reputation: 1710

The method mentioned by @RicardoQs does indeed get rid of the error but I just wanted to add something. If you install node-restful before mongoose, you will get the latest mongoose 3 release which is 3.9.7 . That version is unstable and it introduced an annoying bug.

One thing you can do is:

npm uninstall mongoose

Then go inside package.json and add/modify the more stable mongoose dependency:

"mongoose": "3.8.23"

Finally, run

npm install

And now you have a more stable version of the mongoose package. I recently ran into some issues with 3.9.7 and that's why I wanted to point this out.

Upvotes: 3

RicardoQS
RicardoQS

Reputation: 46

Faced the same problem today

I removed everything that I installed on npm before

 rm -rf ./node_modules ~/.npm

Then I installed the node-restful module first, it will install the correct version of mongoose as dependency

npm install --save node-restful

(I ran this over my project's working directory)

Upvotes: 3

Related Questions