Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency issues even with 0.0.111 version #2616

Closed
ghostenginesio opened this issue Sep 13, 2023 · 4 comments
Closed

Dependency issues even with 0.0.111 version #2616

ghostenginesio opened this issue Sep 13, 2023 · 4 comments
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@ghostenginesio
Copy link

"npm install" is working fine without langchain. This is happening for past 3-5 days.
When I add langchain - 0.0.111 it is breaking. This was working fine earlier.
I even tried with the latest version 0.0.148 still the same issue. Please help me out. Thanks!


npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/cohere-ai
npm ERR! peerOptional cohere-ai@"^6.0.0" from [email protected]
npm ERR! node_modules/chromadb
npm ERR! chromadb@"^1.5.5" from the root project
npm ERR! peerOptional chromadb@"^1.5.3" from [email protected]
npm ERR! node_modules/langchain
npm ERR! langchain@"^0.0.111" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional cohere-ai@"^5.0.2" from [email protected]
npm ERR! node_modules/langchain
npm ERR! langchain@"^0.0.111" from the root project
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.
npm ERR!
npm ERR!

@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Sep 13, 2023
@dosubot
Copy link

dosubot bot commented Sep 13, 2023

🤖

Hello,

I understand you're having trouble with dependency issues when trying to install langchainjs. This seems to be a common issue and there are a few potential solutions that have worked for others in the past.

The error message you're seeing indicates that there's a conflict between the version of cohere-ai your project is using and the version that langchainjs requires. Here's a solution that has worked for a similar issue:

  1. Uninstall the current version of cohere-ai in your project:
npm uninstall cohere-ai
  1. Install the version of cohere-ai required by LangChain 0.0.122:
npm install [email protected]
  1. Uninstall the current version of LangChain in your project:
npm uninstall langchain
  1. Install the new version of LangChain:
npm install [email protected]

This solution was suggested in a similar issue: npm install [email protected] error

If the issue persists, it might be due to other conflicting dependencies in your project. In this case, you might need to update your dependencies to the versions required by LangChain 0.0.144.

Another similar issue was resolved by manually setting the package axios in the package.json to 0.26.1 and installing again to resolve the dependency version conflict. If you encounter the ReferenceError: Headers is not defined error in axios-fetch-adapter.js, install the node-fetch module and add import fetch, { Headers, Request } from "node-fetch"; at the top of axios-fetch-adapter.js. Alternatively, switch to Node.js version 18.x to avoid this error. This solution was suggested in this issue: [email protected] Axios Error

Please try these solutions and let me know if they work for you. If not, we can continue to troubleshoot the issue.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@jacoblee93
Copy link
Collaborator

Hey @ghostenginesio, can you try running with npm install --legacy-peer-deps for now? We'll aim to resolve this and push a release shortly.

@jacoblee93
Copy link
Collaborator

Actually, just tried from a fresh project and it looked like npm install -S langchain worked for me. Can you try clearing any build caches?

@ghostenginesio
Copy link
Author

Works fine now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants