ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
16.25k stars 1.52k forks source link

npm run build error chat_models/ollama #226

Closed Michaelxu2022 closed 4 months ago

Michaelxu2022 commented 4 months ago

hi build error :

node version v20.15.0

npm run build

perplexica-backend@1.7.0 build tsc

src/lib/providers.ts:2:28 - error TS2307: Cannot find module '@langchain/community/chat_models/ollama' or its corresponding type declarations.

2 import { ChatOllama } from '@langchain/community/chat_models/ollama';


src/lib/providers.ts:3:34 - error TS2307: Cannot find module '@langchain/community/embeddings/ollama' or its corresponding type declarations.

3 import { OllamaEmbeddings } from '@langchain/community/embeddings/ollama';

Found 2 errors in the same file, starting at: src/lib/providers.ts

ItzCrazyKns commented 4 months ago

hi build error :

node version v20.15.0

npm run build

perplexica-backend@1.7.0 build tsc

src/lib/providers.ts:2:28 - error TS2307: Cannot find module '@langchain/community/chat_models/ollama' or its corresponding type declarations.

2 import { ChatOllama } from '@langchain/community/chat_models/ollama'; ~~~~~~~~~

src/lib/providers.ts:3:34 - error TS2307: Cannot find module '@langchain/community/embeddings/ollama' or its corresponding type declarations.

3 import { OllamaEmbeddings } from '@langchain/community/embeddings/ollama'; ~~~~~~~~

Found 2 errors in the same file, starting at: src/lib/providers.ts

I believe you are installing manually, I did built the project before releasing and it worked for me. Did you installed all the packages correctly?

phineas-pta commented 4 months ago

im having same error on win 11, using latest commit c626844

also i got this message after run npm i:

added 330 packages, and audited 331 packages in 4m

38 packages are looking for funding
  run `npm fund` for details

1 high severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
phineas-pta commented 4 months ago

i found the workaroud: npm install @langchain/community

but it's supposed to be automatically installed right ? 🤔

ItzCrazyKns commented 4 months ago

image I believed NPM doesn't reads the yarn-lock files but langchain has a dependency on @Langchain/community so it should automatically install it but in case, I'll add it into the package file. Cloning the latest code should fix your issue.