Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm:better-sqlite3 npm:node-libcurl not working #18444

Closed
loynoir opened this issue Mar 26, 2023 · 8 comments
Closed

npm:better-sqlite3 npm:node-libcurl not working #18444

loynoir opened this issue Mar 26, 2023 · 8 comments

Comments

@loynoir
Copy link

loynoir commented Mar 26, 2023

Brief

Node native addon seems not yet supported.

Are there workaround for below cases?

Case: better-sqlite3

import Database from 'npm:better-sqlite3'
const db = new Database(':memory:')
void db
error: Uncaught Error: Could not locate the bindings file. Tried:
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Debug/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Release/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Debug/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/Debug/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Release/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/Release/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/build/default/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/compiled/18.12.1/linux/x64/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/release/install-root/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/debug/install-root/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/default/install-root/better_sqlite3.node
 → /home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/lib/binding/node-v108-linux-x64/better_sqlite3.node
    at bindings (file:///home/vscode/.cache/deno/npm/registry.npmjs.org/bindings/1.5.0/bindings.js:126:9)
    at new Database (file:///home/vscode/.cache/deno/npm/registry.npmjs.org/better-sqlite3/8.2.0/lib/database.js:48:64)
    at file:///tmp/tmp.79CLe5jynp/reproduce.mjs:2:12

Case: node-libcurl

Related
#17910
#8821
#7660

import { curly } from 'npm:node-libcurl'
await curly.get('https://stackoverflow.com/')
error: Uncaught Error: Cannot find module '../lib/binding/node_libcurl.node'
Require stack:
- /home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/Easy.js
- /home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/Curl.js
- /home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/index.js
- /home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/index.js
    at Function.Module._resolveFilename (ext:deno_node/01_require.js:825:15)
    at Function.Module._load (ext:deno_node/01_require.js:657:27)
    at Module.require (ext:deno_node/01_require.js:871:19)
    at require (ext:deno_node/01_require.js:1011:16)
    at Object.<anonymous> (file:///home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/Easy.js:5:18)
    at Object.<anonymous> (file:///home/vscode/.cache/deno/npm/registry.npmjs.org/node-libcurl/3.0.0/dist/Easy.js:15:4)
    at Module._compile (ext:deno_node/01_require.js:938:34)
    at Object.Module._extensions..js (ext:deno_node/01_require.js:971:10)
    at Module.load (ext:deno_node/01_require.js:849:32)
    at Function.Module._load (ext:deno_node/01_require.js:703:12)
@loynoir loynoir changed the title node native addon node native addon should be supported Mar 26, 2023
@ry
Copy link
Member

ry commented Mar 26, 2023

Node-API is supported. I'll rename this issue to npm:better-sqlite3 not working.

https://deno.com/blog/v1.31#stabilization-of-node-api

@ry ry changed the title node native addon should be supported npm:better-sqlite3 not working Mar 26, 2023
@ry ry added the node compat label Mar 26, 2023
@loynoir
Copy link
Author

loynoir commented Mar 26, 2023

@ry

And npm:node-libcurl.
Related
#17910
#8821
#7660

@loynoir loynoir changed the title npm:better-sqlite3 not working npm:better-sqlite3 npm:node-libcurl not working Mar 28, 2023
@andykais
Copy link

also related #15717. better-sqlite3 does not work in 1.33.1

@drewbitt
Copy link

drewbitt commented Jul 26, 2023

Still an issue in v1.35.2

I comment to bring attention to this as the latest blog post states

Next month, we will focus our efforts on getting @grpc/grpc-js, google-cloud-node and various DB drivers working. If you find a package that doesn’t work, please report an issue at denoland/deno repo.

So hope this gets picked up.

@ducktype
Copy link

ducktype commented Feb 29, 2024

Still an issue in v1.41.0

on Windows 11 (no build enviroment msvc or sdk installed)
while running: deno run -A npm:@ulixee/cloud start

if i try to put the .node dynamic lib from:
https://github.com/WiseLibs/better-sqlite3/releases/download/v9.4.3/better-sqlite3-v9.4.3-node-v108-win32-x64.tar.gz
in:
\AppData\Local\deno\npm\registry.npmjs.org\bindings\1.5.0\lib\binding\node-v108-win32-x64\better_sqlite3.node
i get this error:
TypeError: LoadLibraryExW failed

ps: dependency walker on better_sqlite3.node shows an unresolved dependency "node.exe" could be related to not loading node-api at runtime in better_sqlite3.node? something like said here: neon-bindings/neon#584

@reggi
Copy link

reggi commented Mar 29, 2024

I'd like one deno / node sqlite / pg (with typed tables) library 🤞 🙏

Open to any libraries that do this.

It's the only thing making me have to choose deno / node whenever I start a new project.

Currently messing with sequelize / sqlite3 and seeing this error too:

error: Uncaught (in promise) Error: Could not locate the bindings file. Tried:
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/build/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Debug/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/build/Release/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Debug/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/Debug/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/out/Release/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/Release/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/build/default/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/compiled/20.11.1/darwin/arm64/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/release/install-root/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/debug/install-root/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/addon-build/default/install-root/node_sqlite3.node
 → /Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/lib/binding/node-v108-darwin-arm64/node_sqlite3.node
    at bindings (file:///Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/bindings/1.5.0/bindings.js:126:9)
    at Object.<anonymous> (file:///Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/sqlite3/5.1.7/lib/sqlite3-binding.js:1:291)
    at Object.<anonymous> (file:///Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/sqlite3/5.1.7/lib/sqlite3-binding.js:3:4)
    at Module._compile (node:module:718:34)
    at Object.Module._extensions..js (node:module:732:10)
    at Module.load (node:module:643:32)
    at Function.Module._load (node:module:524:12)
    at Module.require (node:module:662:19)
    at require (node:module:776:16)
    at Object.<anonymous> (file:///Users/thomasreggi/Library/Caches/deno/npm/registry.npmjs.org/sqlite3/5.1.7/lib/sqlite3.js:2:17)

@loynoir
Copy link
Author

loynoir commented Mar 29, 2024

Close in favor of #19130

@loynoir loynoir closed this as completed Mar 29, 2024
@loynoir
Copy link
Author

loynoir commented Mar 29, 2024

Quote myself #15717 (comment)

I think it is blocked by #19130

Expect to search under /home/vscode/.cache/deno/npm/private-npm/napi-example/1.0.0.

But actually search under /home/vscode/.cache/deno/npm/private-npm/bindings/1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants