IroncladDev / LangChain.js-LLM-Template

This is a LangChain LLM template that allows you to train your own custom AI LLM.
321 stars 52 forks source link

Error On `npm i` or `yarn` #3

Open TechLionDev opened 1 year ago

TechLionDev commented 1 year ago

Specifically caused by: hnswlib-node

TechLionDev commented 1 year ago

image

IroncladDev commented 1 year ago

Install hnswlib-node and see if that works

TechLionDev commented 1 year ago

I tried and it gives me a different error message

Will attach in next comment

On Mon, Mar 27, 2023 at 5:58 AM IroncladDev @.***> wrote:

Install hnswlib-node and see if that works

— Reply to this email directly, view it on GitHub https://github.com/Conner1115/LangChain.js-LLM-Template/issues/3#issuecomment-1484850368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYP25PBZGIWFHEKM4W6IFXTW6FQDDANCNFSM6AAAAAAWIKME4E . You are receiving this because you authored the thread.Message ID: @.***>

-- [image: avatar]

Jeremiah Ihab Samuel

Full Stack Developer / TechLion Dev

Website: www.techlion.dev

Email: @.***

Phone: +1 (732) 788-6322 <+1+(732)+788-6322>

[image: social-icon-youtube] @.***>

[image: social-icon-github] https://github.com/JeremiahISDev

TechLionDev commented 1 year ago

I get this Error:

yarn add v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > langchain@0.0.11" has unmet peer dependency "huggingface@^1.4.0".
[4/4] Building fresh packages...
error /home/runner/ask-pope-shenouda-iii/node_modules/hnswlib-node: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/runner/ask-pope-shenouda-iii/node_modules/hnswlib-node
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@18.12.1 | linux | x64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:420:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:432:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Linux 5.15.0-1030-gcp
gyp ERR! command "/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/bin/node" "/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/runner/ask-pope-shenouda-iii/node_modules/hnswlib-node
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
TechLionDev commented 1 year ago

It's in repl.it btw, works fine locally, but get this error on netlify or vercel deploy and repl.it

IroncladDev commented 1 year ago

make sure python works in the environment. Copy over replit.nix.

The python command has to be enabled for node-gyp

TechLionDev commented 1 year ago

Tried and it did nt work