I am building this web app that will allow a user to chat with their pdf. I am using pinecone as the vector database and also using langchain. So I npm installed pinecone before langchain but when it came to installing langchain I got an error about peer dependency issues between the two packages.
The error indicates that there is a conflict between the required version of @pinecone-database/pinecone in the @langchain/community package ("^1.1.0") and the version found in the root project ("^2.0.1"). Typically this error has been consistently present at the very last minute whenever I tried installing any dependency from that point on and results in failure to properly install them.
here:
npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @langchain/[email protected] npm ERR! Found: @pinecone-database/[email protected] npm ERR! node_modules/@pinecone-database/pinecone npm ERR! @pinecone-database/pinecone@"^2.0.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional @pinecone-database/pinecone@"^1.1.0" from @langchain/[email protected] npm ERR! node_modules/@langchain/community npm ERR! @langchain/community@"~0.0.17" from [email protected] npm ERR! node_modules/langchain npm ERR! langchain@"^0.1.4" from the root project npm ERR! @langchain/community@"^0.0.19" from the root project npm ERR! npm ERR! Conflicting peer dependency: @pinecone-database/[email protected] npm ERR! node_modules/@pinecone-database/pinecone npm ERR! peerOptional @pinecone-database/pinecone@"^1.1.0" from @langchain/[email protected] npm ERR! node_modules/@langchain/community npm ERR! @langchain/community@"~0.0.17" from [email protected] npm ERR! node_modules/langchain npm ERR! langchain@"^0.1.4" from the root project npm ERR! @langchain/community@"^0.0.19" 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! npm ERR! For a full report see: npm ERR! C:\Users\Admin\AppData\Local\npm-cache_logs\2024-01-22T07_42_33_360Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\Admin\AppData\Local\npm-cache_logs\2024-01-22T07_42_33_360Z-debug-0.log
To solve this issue, I previously flagged them using --legacy-peer-deps flag and that allowed me to install any package along the way.
I also attempted to update the packages using the command 'npm update'
However, whenever I needed to run a command that starts with npx, like for example npx shadcn-ui@latest add tooltip, the component won't be installed because npx doesn't recognize the --legacy-peer-deps flag and neither the --force flag as well.
I have tried looking for solutions everywhere including the langchain documentation but none has helped solve this issue so far.