Description
When installing chdb in a Deno project (using Deno's native npm integration with allowScripts), the installation fails with errors like:
error: Task libchdb not found or error: Task build not found.
Why does this happen?
Deno has a built-in task runner that intercepts npm run commands inside package lifecycles, attempting to map them to deno task in the root deno.json.
Since chdb-node's "install" and "build" scripts rely on nested npm run invocations, Deno intercepts them, fails to find those tasks at the project root, and aborts the installation.
Current Problematic Scripts
In package.json:
"scripts": {
"install": "npm run libchdb && npm run build",
"libchdb": "bash ./update_libchdb.sh",
"fixloaderpath": "bash ./fix_loader_path.sh",
"build": "node-gyp configure build --verbose && npm run fixloaderpath"
}
Proposed Solution
We can bypass Deno's task interception entirely by invoking the underlying shell scripts and tools (bash and node-gyp) directly, rather than nesting them through npm run. This fix is simple, has zero dependencies, and remains 100% backward-compatible with Node.js/npm.
Proposed changes in package.json:
"scripts": {
"install": "bash ./update_libchdb.sh && node-gyp configure build --verbose && bash ./fix_loader_path.sh",
"test": "mocha test_basic.js test_connection.js --timeout 15000",
"libchdb": "bash ./update_libchdb.sh",
"fixloaderpath": "bash ./fix_loader_path.sh",
"build": "node-gyp configure build --verbose && bash ./fix_loader_path.sh"
}
Benefits
- Enables seamless, native compatibility with Deno's package manager and
deno compile.
- Fully preserves existing Node.js and npm behaviors.
- No code changes required, only minor adjustments in
package.json.
I would be happy to submit a Pull Request (PR) with these changes if you are open to it!
Description
When installing
chdbin a Deno project (using Deno's native npm integration withallowScripts), the installation fails with errors like:error: Task libchdb not foundorerror: Task build not found.Why does this happen?
Deno has a built-in task runner that intercepts
npm runcommands inside package lifecycles, attempting to map them todeno taskin the rootdeno.json.Since
chdb-node's"install"and"build"scripts rely on nestednpm runinvocations, Deno intercepts them, fails to find those tasks at the project root, and aborts the installation.Current Problematic Scripts
In
package.json:Proposed Solution
We can bypass Deno's task interception entirely by invoking the underlying shell scripts and tools (
bashandnode-gyp) directly, rather than nesting them throughnpm run. This fix is simple, has zero dependencies, and remains 100% backward-compatible with Node.js/npm.Proposed changes in
package.json:Benefits
deno compile.package.json.I would be happy to submit a Pull Request (PR) with these changes if you are open to it!