question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

conflicting mongoose versions in package.json

See original GitHub issue

The package.json file has conflicting mongoose versions listed in dependencies ("^5.8.10")and peerDependencies ("^4.0.0"). This is resulting in the following error:

npm ERR! peer dep missing: mongoose@^4.0.0, required by express-restify-mongoose@6.0.0

History:

  • Mongoose was moved from dependencies to peerDependencies back in October 2015 (7910bc8fb3503c32306c7d0c09b67128956a1373), and that line hasn’t been changed since then.
  • It was then added again to dependencies in November 2019 (a7f079abe4e4c91c14a2bf6c78d7bd2fd1275187)
  • From then on, only the version in dependencies was updated.

I’m not sure how you want to approach this, but either the peerDependencies version should be updated and the line dependencies removed or the peerDependencies line should be removed.

I’d be happy to submit a PR if that would make things easier for you; just let me know which approach you’d like to take.

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
florianholzapfelcommented, Jul 17, 2020

I also feel like peerDependencies is the way to go

0reactions
kswedbergcommented, Jul 17, 2020

You’re welcome! And thanks for the quick reply.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How does NPM handle version conflicts ? - GeeksforGeeks
json file. So, it will encounter module A (version 1) first and install it as root dependency under node_modules. Now when npm is...
Read more >
How do I read npm "conflicting peer dependency" error ...
First, delete the node_modules folder in your project. Yarn will complain about any package-lock.json files, so delete that too (or back it up, ......
Read more >
Type Definitions conflict with those in mongoose 5.11 #49950
I understand that @types package versions do not follow SemVer. I have a question that is inappropriate for StackOverflow. Authors: @guillem- ...
Read more >
How does npm handle conflicting package versions?
Npm installs dependencies in the order they are listed in package.json . It first encounters moduleA and goes ahead installing it because it's...
Read more >
Mongoose v6.8.2: FAQ
A. This issue is a result of having multiple versions of mongoose installed that are incompatible with each other. Run npm list |...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found