-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 support did not resolve the node dependencies (knex, better-sqlite3) #15717
Comments
I get a completely different error on latest
I assume the root cause has already been fixed and will be released in v1.25.1 tonight, but we need need to address problem with |
That is great! Thanks for your work a lot! |
If I add
|
Just tried with #13633 and it appears to resolve this issue. |
I just tried this with deno 1.29.4 and it does not appear to be resolved. import Database from 'npm:better-sqlite3'
const db = new Database(':memory:')
I have tried this on both an M1 mac and linux. Listing the files inside that bindings folder, I see this:
|
Just another update (mostly to keep the git bot from marking this stale 😅). This appears to still be broken in deno 1.30.0 |
adding another to the mix, an asynchronous sqlite library https://www.npmjs.com/package/sqlite3 (which the readme specifies uses node-pre-gyp to download prebuilt binaries)
I dont personally need this library for any projects, but I discovered this while attempting to compile a few benchmarks. Similarly, the folder which it expects to contain the binary is empty:
|
this still appears to be broken in deno v1.31. Adding this comment because the 1.31 blog post points out a stabilization of the Node-API, which better-sqlite3 seems to be built off of https://deno.com/blog/v1.31#stabilization-of-node-api. I think this is perhaps because deno attempts to download only the files that are part of the dependency tree, or defined in the package.json file. On the other hand, I believe npm just downloads everything in the published tarball. This is the contents of the package.json {
"name": "bindings",
"description": "Helper module for loading your native module's .node file",
"keywords": [
"native",
"addon",
"bindings",
"gyp",
"waf",
"c",
"c++"
],
"version": "1.5.0",
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-bindings.git"
},
"main": "./bindings.js",
"bugs": {
"url": "https://github.com/TooTallNate/node-bindings/issues"
},
"homepage": "https://github.com/TooTallNate/node-bindings",
"license": "MIT",
"dependencies": {
"file-uri-to-path": "1.0.0"
}
}
|
another native library failed. This one is https://github.com/cocktailpeanut/dalai (https://www.npmjs.com/package/dalai), which was a recent share on HN that runs facebook's llama.cpp language model natively. The error is below:
tested on linux, also |
This is still a problem in deno WiseLibs/better-sqlite3#1034 (comment)
|
It looks to me like this is still a problem in deno 1.44.2 |
Adds support for `npm:bindings` and `npm:callsites` packages because of changes in denoland/deno_core#838. This `deno_core` bump causes us to stop prepending `file://` scheme for locations in stack traces that are for local files. Fixes #24462 , fixes #22671 , fixes #15717 , fixes #19130 , fixes WiseLibs/better-sqlite3#1205 , fixes WiseLibs/better-sqlite3#1034 , fixes #20936 --------- Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
hmm so I see the pr that closed this issue was part of the 1.45.5 release (sidenote: I found by poking around the Releases on github, it would be ideal if I could link my way from an issue/pr to the deno release that it arrived in. Weirdly, I can see this pr merged as this commit into main here but it doesnt reference where it appears in the 1.45.5 tag commits here This does not appear to be fixed though on macos.
This snippet: import * as sqlite from 'npm:better-sqlite3@11.1.2'
const database = new sqlite.default(':memory:') gives the following output:
|
Env
Phenomenon
Run the code:
And throw exception:
Then find the keyword in the
tarn
package:Expected
Resolve the node dependencies.
The text was updated successfully, but these errors were encountered: