LanceDB version
v0.27.2
What happened?
📋 Description
When attempting to run npm run build:release in the nodejs directory, the build process fails during the postbuild:release hook. The error indicates that the source file for the copy command cannot be found.
ℹ️ Environment
- OS: Linux
- Node.js Version: v22.22.2
📝 Steps to Reproduce
- Navigate to the
nodejs directory.
- Run the command:
npm run build:release
❌ Error Log
> @lancedb/[email protected] postbuild:release
> shx mkdir -p dist && shx cp lancedb/*.node dist/
cp: no such file or directory: lancedb/*.node
🔍 Analysis
I have analyzed the scripts defined in package.json:
build:release: "napi build --platform --release --dts ../lancedb/native.d.ts --js ../lancedb/native.js --output-dir dist"
postbuild:release: "shx mkdir -p dist && shx cp lancedb/*.node dist/"
Root Cause:
The build:release command uses the flag --output-dir dist, which correctly generates the lancedb.*.node files directly into the dist/ directory. Consequently, the lancedb/ source directory does not contain any *.node files.
When the postbuild:release script attempts to execute cp lancedb/*.node dist/, it fails because the source files do not exist in the lancedb/ folder.
💡 Proposed Solution
I suggest fixing this issue using one of the following methods:
-
Remove the redundant script:
Simply delete the postbuild:release script from package.json, as the files are already in the correct destination (dist/) after the build.
OR
-
Adjust the output directory:
Modify the build:release script to point the --output-dir parameter to lancedb instead of dist (if the copy step is strictly required for a specific structure).
If there are no objections, I would be happy to open a PR to fix this issue (likely via solution 1).
Are there known steps to reproduce?
See the description above.
LanceDB version
v0.27.2
What happened?
📋 Description
When attempting to run
npm run build:releasein thenodejsdirectory, the build process fails during thepostbuild:releasehook. The error indicates that the source file for the copy command cannot be found.ℹ️ Environment
📝 Steps to Reproduce
nodejsdirectory.npm run build:release❌ Error Log
🔍 Analysis
I have analyzed the scripts defined in
package.json:build:release:"napi build --platform --release --dts ../lancedb/native.d.ts --js ../lancedb/native.js --output-dir dist"postbuild:release:"shx mkdir -p dist && shx cp lancedb/*.node dist/"Root Cause:
The
build:releasecommand uses the flag--output-dir dist, which correctly generates thelancedb.*.nodefiles directly into thedist/directory. Consequently, thelancedb/source directory does not contain any*.nodefiles.When the
postbuild:releasescript attempts to executecp lancedb/*.node dist/, it fails because the source files do not exist in thelancedb/folder.💡 Proposed Solution
I suggest fixing this issue using one of the following methods:
Remove the redundant script:
Simply delete the
postbuild:releasescript frompackage.json, as the files are already in the correct destination (dist/) after the build.OR
Adjust the output directory:
Modify the
build:releasescript to point the--output-dirparameter tolancedbinstead ofdist(if the copy step is strictly required for a specific structure).If there are no objections, I would be happy to open a PR to fix this issue (likely via solution 1).
Are there known steps to reproduce?
See the description above.