Open mkarolczyk opened 1 month ago
During my troubleshooting, I discovered that running npm run build on the binary and installing @lancedb/vectordb-xxx leads to an overwrite issue.
For instance, there's a requirement to bundle the following dependencies into the plugin. However, in practice, only the last one is actually bundled, resulting in a missing dependency issue:
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
"darwin-x64": "@lancedb/vectordb-darwin-x64",
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
"linux-x64": "@lancedb/vectordb-linux-x64-gnu",
"win32-x64": "@lancedb/vectordb-win32-x64-msvc",
"win32-arm64": "@lancedb/vectordb-win32-x64-msvc",
I resolved this issue by modifying binary/build.js:
.....
async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
console.log(`Copying ${packageName} to ${toCopy}`);
// This is a way to install only one package without npm trying to install all the dependencies
// Create a temporary directory for installing the package
const adjustedName = toCopy.replace(/^@/, "").replace("/", "-");
const tempDir = path.join(
__dirname,
"tmp",
`continue-node_modules-${adjustedName}`,
packageName,
);
........
By including the packageName in tempDir, I successfully addressed the dependency overwrite issue.
Hope it helps you.
Before submitting your bug report
Relevant environment info
Description
'm encountering an error while updating the vectordb::voyage-code-2 index within a JetBrains plugin. The error message suggests that the native library failed to load.
To reproduce
Run IDE
Log output