Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HNSWLib not compatible with 0.0.96 #1764

Closed
shawnesquivel opened this issue Jun 26, 2023 · 13 comments
Closed

HNSWLib not compatible with 0.0.96 #1764

shawnesquivel opened this issue Jun 26, 2023 · 13 comments
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@shawnesquivel
Copy link

shawnesquivel commented Jun 26, 2023

Trying to use HNSWLib-node

Error message:


Please install hnswlib-node as a dependency with e.g., `npm install -S hnswlib-node` 

With LangChain 0.0.96

@shawnesquivel
Copy link
Author

This was fixed in the interim by downgrading to version 0.0.75.

Will there be any fix for this?

@gregorym
Copy link

Also facing the same error

@shawnesquivel
Copy link
Author

@gregorym were you able to fix it or just downgraded for now?

@shawnesquivel shawnesquivel changed the title HNSWLib not compatible HNSWLib not compatible with 0.0.96 Jun 27, 2023
@gregorym
Copy link

I havent' tried yet but I also found this #943

@jacoblee93
Copy link
Collaborator

Best I can tell the version of HNSWLib used hasn't changed - can you give me a bit more info about your setup?

@matiasmm
Copy link

matiasmm commented Jul 6, 2023

I'm experiencing the same thing, and I've debugged the line where the error is happening.

You can see that is throwing a new Exception and ignoring the orignal one (of the previous line). So the original cause of the issue is hidden.

in MY case (which might not be everybody's case) the actual error that is causing this is:

"You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules"

So I would ask console.log the actual err variable in addition to this human readable error that might not be accurate

@jacoblee93
Copy link
Collaborator

Agree we should log the error - want to open a PR? Otherwise I can add it when I get a minute.

@dmb0058
Copy link

dmb0058 commented Jul 10, 2023

Is there a known combination of langchain and hnswlib that works on lambda?

With hnswlib-node 1.4.2 and langchain downgraded to 0.0.75 I get the "Please install hnswlib-node as a dependency with, e.g. npm install -S hnswlib-node" error.

With hnswlib-node 1.4.2 and langchain 0.0.105 the error is slightly different: "Could not import hnswlib-node. Please install hnswlib-node as a dependency with, e.g. npm install -S hnswlib-node. Error: /opt/nodejs/node_modules/hnswlib-node/build/Release/addon.node: cannot open shared object file: No such file or directory"

@batjko
Copy link

batjko commented Sep 6, 2023

I had the same on Node 18 and Langchain 0.0.143.
But then I installed hnswlib-node manually and it started working fine (ran into different issue after that, but it created the vector store with it at least).

@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Sep 11, 2023
@dominicdev
Copy link

I had the same on Node 18 and Langchain 0.0.143. But then I installed hnswlib-node manually and it started working fine (ran into different issue after that, but it created the vector store with it at least).

how to you install manually?

@batjko
Copy link

batjko commented Oct 18, 2023

how to you install manually?

The usual npm install hnswlib-node, like any other node package.
It may require you to install some native build tools, e.g. on Linux I needed to make sure to have these:

$ sudo apt-get install -y build-essential gcc python3 make

@DutchPrince
Copy link

DutchPrince commented Oct 30, 2023

I have the same issue with node versions 18.18.2 - 20.9.0 on MacOS

edit: #943 (comment) this worked for me :)

Copy link

dosubot bot commented Jan 30, 2024

Hi, @shawnesquivel,

I'm helping the langchainjs team manage their backlog and am marking this issue as stale. It seems that the issue you raised regarding the compatibility problem with HNSWLib-node library and version 0.0.96 of LangChain has not been resolved yet. Several users, including gregorym, matiasmm, and DutchPrince, reported experiencing the same issue. There were discussions around temporary workarounds such as downgrading LangChain or manually installing hnswlib-node, but no official resolution has been provided.

Could you please confirm if this issue is still relevant to the latest version of the langchainjs repository? If it is, please let the langchainjs team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the langchainjs community.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jan 30, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants