Skip to content

Commit

Permalink
Merge pull request #1799 from kuzudb/debug-nodejs-publish
Browse files Browse the repository at this point in the history
Resolve npm publish issue due to symlink
  • Loading branch information
mewim committed Jul 10, 2023
2 parents 955c4c5 + 33edb5e commit 7ec4007
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/nodejs_api/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,17 @@ const KUZU_VERSION_TEXT = "Kuzu VERSION";
}

packageJson.scripts.install = "node install.js";
// npm modifies environment variables during install, which causes build
// errors on Windows. This is a workaround.
// packageJson.scripts.preinstall = "npm config set ignore-scripts true";
// packageJson.scripts.postinstall = "npm config set ignore-scripts false";

await fs.writeFile(
path.join(ARCHIVE_DIR_PATH, "package.json"),
JSON.stringify(packageJson, null, 2)
);

console.log("Removing symlink...");
// There is a symlink in the rust_api directory, so we need to remove it.
// Otherwise, the tarball will be rejected by npm.
await fs.unlink(path.join(ARCHIVE_DIR_PATH, "kuzu-source", "tools", "rust_api", "kuzu-src"))

console.log("Creating tarball...");
// Create the tarball
await new Promise((resolve, reject) => {
Expand Down

0 comments on commit 7ec4007

Please sign in to comment.