Closed sivadassilpa closed 1 year ago
🤖
Hello,
The errors you're encountering seem to be related to the TypeScript configuration and missing dependencies in your project. Here are some steps you can take to resolve these issues:
Update your TypeScript configuration: The 'resolution-mode' assertions are only supported when moduleResolution is node16 or nodenext. You can add "moduleResolution": "node16"
to your tsconfig.json file.
Install missing dependencies: The errors indicate that certain modules cannot be found. These modules are likely peer dependencies of langchainjs that need to be installed separately. You can install these dependencies using npm or yarn. For example:
npm install cohere-ai@6.0.0
npm install chromadb
npm install @huggingface/inference
npm install replicate
npm install @supabase/supabase-js
npm install @supabase/postgrest-js
Skip library type checking: You can add "skipLibCheck": true
to your tsconfig.json file. This will skip type checking of all declaration files (*.d.ts).
Ensure you have the latest version of langchainjs installed: Uninstall the current version using npm uninstall langchain
and then reinstall it using npm install -S langchain
.
Use Yarn for dependency management: The langchainjs project is configured to use Yarn as its package manager. If you're not already using Yarn, you can install it with npm install -g yarn
and then run yarn install
to install the project dependencies.
Ensure you're using the correct Node.js version: The minimum required version of Node.js for the langchainjs repository is 20. You can check your Node.js version with node -v
and update it if necessary.
Please try these steps and let me know if you're still encountering issues.
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.
It was solved when i added "skipLibCheck": true to my tsconfig and I deleted the tsconfi.eslint.json file
@dosu-bot
I have an issue like this `Starting compilation in watch mode...
node_modules/langchain/dist/document_loaders/fs/buffer.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when moduleResolution is node16 or nodenext.
1 ///
node_modules/langchain/dist/document_loaders/fs/directory.d.ts:1:23 - error TS1452: 'resolution-mode' assertions are only supported when moduleResolution is node16 or nodenext.
1 ///
node_modules/langchain/dist/document_loaders/fs/pdf.d.ts:1:22 - error TS6053: File 'C:/Users/CibusCell/Desktop/work/cibuscell-dashboard-api/node_modules/langchain/src/types/pdf-parse.d.ts' not found.
1 ///
node_modules/langchain/dist/document_loaders/fs/pdf.d.ts:15:32 - error TS2307: Cannot find module 'pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js' or its corresponding type declarations.
15 getDocument: typeof import("pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js").getDocument;
node_modules/langchain/dist/embeddings/cohere.d.ts:50:31 - error TS2307: Cannot find module 'cohere-ai' or its corresponding type declarations.
50 cohere: typeof import("cohere-ai");
node_modules/langchain/dist/llms/hf.d.ts:37:36 - error TS2307: Cannot find module '@huggingface/inference' or its corresponding type declarations.
37 HfInference: typeof import("@huggingface/inference").HfInference;
node_modules/langchain/dist/vectorstores/chroma.d.ts:1:64 - error TS2307: Cannot find module 'chromadb' or its corresponding type declarations.
1 import type { ChromaClient as ChromaClientT, Collection } from "chromadb";
node_modules/langchain/dist/vectorstores/pinecone.d.ts:5:46 - error TS2307: Cannot find module '@pinecone-database/pinecone' or its corresponding type declarations.
5 type VectorOperationsApi = ReturnTypeimport("@pinecone-database/pinecone").PineconeClient["Index"];
node_modules/langchain/dist/vectorstores/supabase.d.ts:2:45 - error TS2307: Cannot find module '@supabase/postgrest-js' or its corresponding type declarations.
2 import type { PostgrestFilterBuilder } from "@supabase/postgrest-js";