[X] I added a very descriptive title to this issue.
[X] I searched the LangChain.js documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain.js rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
Steps to Reproduce:
Set up a project with mongodb@^6.7.0 as a dependency.
Add @langchain/community@^0.2.28 as a dependency.
Run npm install.
Observe the dependency conflict error.
Error Message and Stack Trace (if applicable)
npm i @langchain/community pdf-parse
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: hana-server@41.0.0
npm ERR! Found: mongodb@6.7.0
npm ERR! node_modules/mongodb
npm ERR! mongodb@"^6.3.0" from @langchain/mongodb@0.0.1
npm ERR! node_modules/@langchain/mongodb
npm ERR! @langchain/mongodb@"^0.0.1" from the root project
npm ERR! peerOptional mongodb@">=5.2.0" from langchain@0.1.36
npm ERR! node_modules/langchain
npm ERR! langchain@"^0.1.36" from the root project
npm ERR! 2 more (@langchain/community, mongoose)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @langchain/community@"" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: mongodb@5.9.2
npm ERR! node_modules/mongodb
npm ERR! peerOptional mongodb@"^5.8.0" from typeorm@0.3.20
npm ERR! node_modules/typeorm
npm ERR! peerOptional typeorm@"^0.3.20" from @langchain/community@0.2.28
npm ERR! node_modules/@langchain/community
npm ERR! @langchain/community@"" from the root project
npm ERR! peerOptional typeorm@"^0.3.12" from langchain@0.1.37
npm ERR! node_modules/langchain
npm ERR! langchain@"^0.1.36" from the root project
npm ERR! 1 more (@getzep/zep-cloud)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Description
We are encountering a dependency conflict in our project due to a mismatch in the mongodb version required by the @langchain/community package. Our project requires mongodb@^6.7.0, but the @langchain/community package specifies a peer dependency on mongodb@^5.9.2. This mismatch leads to npm installation errors, preventing us from setting up our project.
Proposed Solution:
Upgrade the mongodb dependency in the @langchain/community package to align with the latest version required by other packages (i.e., mongodb@^6.7.0). This will resolve the dependency conflict and allow for smooth project setup.
Impact:
This issue blocks our project setup and development, requiring us to use workarounds like --legacy-peer-deps, which could lead to further issues down the line.
Checked other resources
Example Code
Steps to Reproduce:
Error Message and Stack Trace (if applicable)
npm i @langchain/community pdf-parse npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: hana-server@41.0.0 npm ERR! Found: mongodb@6.7.0 npm ERR! node_modules/mongodb npm ERR! mongodb@"^6.3.0" from @langchain/mongodb@0.0.1 npm ERR! node_modules/@langchain/mongodb npm ERR! @langchain/mongodb@"^0.0.1" from the root project npm ERR! peerOptional mongodb@">=5.2.0" from langchain@0.1.36 npm ERR! node_modules/langchain npm ERR! langchain@"^0.1.36" from the root project npm ERR! 2 more (@langchain/community, mongoose) npm ERR! npm ERR! Could not resolve dependency: npm ERR! @langchain/community@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: mongodb@5.9.2 npm ERR! node_modules/mongodb npm ERR! peerOptional mongodb@"^5.8.0" from typeorm@0.3.20 npm ERR! node_modules/typeorm npm ERR! peerOptional typeorm@"^0.3.20" from @langchain/community@0.2.28 npm ERR! node_modules/@langchain/community npm ERR! @langchain/community@"" from the root project npm ERR! peerOptional typeorm@"^0.3.12" from langchain@0.1.37 npm ERR! node_modules/langchain npm ERR! langchain@"^0.1.36" from the root project npm ERR! 1 more (@getzep/zep-cloud) npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Description
We are encountering a dependency conflict in our project due to a mismatch in the mongodb version required by the @langchain/community package. Our project requires mongodb@^6.7.0, but the @langchain/community package specifies a peer dependency on mongodb@^5.9.2. This mismatch leads to npm installation errors, preventing us from setting up our project.
Proposed Solution:
Upgrade the mongodb dependency in the @langchain/community package to align with the latest version required by other packages (i.e., mongodb@^6.7.0). This will resolve the dependency conflict and allow for smooth project setup.
Impact:
This issue blocks our project setup and development, requiring us to use workarounds like --legacy-peer-deps, which could lead to further issues down the line.
System Info
Node.js: v20.10.0 npm: v10.2.3 OS: Windows 10 Pro