I'm building something that depends on a library with a native component (pulsar-client) and it doesn't work directly in deno because of #16164. I'm trying to use the workaround described in https://github.com/denoland/deno/issues/15611#issuecomment-1330469239 to manually run the dependency's
install
install
script. This works fine in macOS, but in a Docker build the command fails when afaict it's trying to untar what the NAPI glibc tarball.
The failing command is
deno run --allow-all npm:@mapbox/node-pre-gyp@1.0.9 install --fallback-to-build
deno run --allow-all npm:@mapbox/node-pre-gyp@1.0.9 install --fallback-to-build
And in the Docker build I get
5.681 node-pre-gyp http GET https://archive.apache.org/dist/pulsar/pulsar-client-node/pulsar-client-node-1.9.0/napi-linux-glibc-x64.tar.gz6.041 node-pre-gyp info install unpacking binding/pulsar.node7.241 node-pre-gyp info extracted file count: 17.244 [pulsar-client] Success: "/app/node_modules/.deno/pulsar-client@1.9.0/node_modules/pulsar-client/lib/binding/pulsar.node" is installed via remote7.246 node-pre-gyp info oknode-pre-gyp ERR! UNCAUGHT EXCEPTIONnode-pre-gyp ERR! stack TypeError: fs.fchown is not a functionnode-pre-gyp ERR! stack at WriteStream.<anonymous> (file:///app/node_modules/.deno/pulsar-client@1.9.0/node_modules/pulsar-client/node_modules/.deno/tar@6.1.15/node_modules/tar/lib/unpack.js:465:12)
5.681 node-pre-gyp http GET https://archive.apache.org/dist/pulsar/pulsar-client-node/pulsar-client-node-1.9.0/napi-linux-glibc-x64.tar.gz6.041 node-pre-gyp info install unpacking binding/pulsar.node7.241 node-pre-gyp info extracted file count: 17.244 [pulsar-client] Success: "/app/node_modules/.deno/pulsar-client@1.9.0/node_modules/pulsar-client/lib/binding/pulsar.node" is installed via remote7.246 node-pre-gyp info oknode-pre-gyp ERR! UNCAUGHT EXCEPTIONnode-pre-gyp ERR! stack TypeError: fs.fchown is not a functionnode-pre-gyp ERR! stack at WriteStream.<anonymous> (file:///app/node_modules/.deno/pulsar-client@1.9.0/node_modules/pulsar-client/node_modules/.deno/tar@6.1.15/node_modules/tar/lib/unpack.js:465:12)
I tried to import sqlite3 via npm. As shown below, import sqlite from "npm:sqlite3"; console.log(sqlite); deno --unstable run -A tmp.ts Then I got the following error. error: Uncaught Err...