conflicting mongoose versions in package.json
See original GitHub issueThe 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
topeerDependencies
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:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also feel like
peerDependencies
is the way to goYou’re welcome! And thanks for the quick reply.