Unable to import langchain

Hi,

Hope this finds you well. I am trying to

import { HuggingFaceInference } from ‘langchain/integrations/huggingface’;
import { PromptTemplate } from ‘langchain/prompts’;
import { RunnableSequence } from ‘langchain/schema/runnable’;

But i keep getting Cannot find module ‘langchain/integrations/huggingface’ or its corresponding type declarations.ts(2307).

i have tried uninstalling langchain, i tried restarting the Ts Server, tried installing different version of langchain but nothing seems to work :frowning:
If you could please help that would be so great.

Thank you so much

1 Like

I can’t read TypeScript code at all, but it seems that up to a certain point there was a bug in the LangChain library for TS that made installation difficult.

It is not impossible that this is a TS2307 problem.

In any case, it seems to me that you are definitely stumbling on some TS-specific issue. If you have a recent example that worked well, the quickest thing to do is to copy it…