Closed dingens closed 3 years ago
For completeness, of course I executed npm install
(which compiled better-sqlite from scratch it seems) before running the script. Here's its output:
/tmp/jwbayK$ npm install
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2752/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> better-sqlite3@7.0.1 install /tmp/jwbayK/node_modules/better-sqlite3
> prebuild-install || npm run build-release
prebuild-install WARN install No prebuilt binaries found (target=14.3.0 runtime=node arch=x64 libc= platform=linux)
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2752/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> better-sqlite3@7.0.1 build-release /tmp/jwbayK/node_modules/better-sqlite3
> node-gyp rebuild --release
make: Entering directory '/tmp/jwbayK/node_modules/better-sqlite3/build'
TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
TOUCH Release/obj.target/deps/locate_sqlite3.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
AR(target) Release/obj.target/deps/sqlite3.a
COPY Release/sqlite3.a
CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
In file included from ./src/better_sqlite3.lzz:10,
from ../src/better_sqlite3.cpp:4:
/home/mfu/.cache/node-gyp/14.3.0/include/node/node.h:749:51: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to ‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)’} [-Wcast-function-type]
749 | (node::addon_context_register_func) (regfunc), \
| ^
/home/mfu/.cache/node-gyp/14.3.0/include/node/node.h:767:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
767 | NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mfu/.cache/node-gyp/14.3.0/include/node/node.h:798:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
798 | NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~
./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
./src/objects/database.lzz: In static member function ‘static void Database::JS_new(const v8::FunctionCallbackInfo<v8::Value>&)’:
./src/objects/database.lzz:172:21: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
./src/util/data.lzz:75:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:75:197: note: here
./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
./src/util/data.lzz:79:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
./src/util/data.lzz:79:175: note: here
SOLINK_MODULE(target) Release/obj.target/better_sqlite3.node
COPY Release/better_sqlite3.node
CC(target) Release/obj.target/test_extension/deps/test_extension.o
SOLINK_MODULE(target) Release/obj.target/test_extension.node
COPY Release/test_extension.node
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
make: Leaving directory '/tmp/jwbayK/node_modules/better-sqlite3/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN demo@0.0.1 No description
npm WARN demo@0.0.1 No repository field.
npm WARN demo@0.0.1 No license field.
added 68 packages from 38 contributors and audited 68 packages in 61.014s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
(I've also tried using the mentioned --scripts-prepend-node-path
option, still the same error.)
JFTR, this still occurs on Ubuntu 20.04. System Info:
snap node 14.4.0
snap core 16-2.45.2
Linux 5.4.0-42-generic x86_64
libc6 2.31-0ubuntu9
Log:
Error: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ***/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
Thinking this might be an issue with snap itself, I've reported a bug about the core snap, but they say it's the node
snap's issue. As I've not found that many issues involving the node snap, I think it might have to do with this package after all.
See also https://github.com/nodesource/distributions/issues/804 . This issue also mentions gyp as a potential cause.
Do you think it might be a problem with better-sqlite3
's build configuration or so? Or do you think I should open an issue about the node snap? (Or about gyp?) Unfortunately, I don't know much about node so I myself cannot really judge where the problem lies. Thanks for any help!
Any news on this. I am having a similar problem:
internal/modules/cjs/loader.js:1302
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/joaquim/Code/Enel/dr-customer-offers-ui/node_modules/node-sass/vendor/linux-x64-83/binding.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1302:18)
at Module.load (internal/modules/cjs/loader.js:1100:32)
at Function.Module._load (internal/modules/cjs/loader.js:962:14)
at Module.require (internal/modules/cjs/loader.js:1140:19)
at require (internal/modules/cjs/helpers.js:75:18)
at module.exports (/home/joaquim/Code/Enel/dr-customer-offers-ui/node_modules/node-sass/lib/binding.js:19:10)
at Object.<anonymous> (/home/joaquim/Code/Enel/dr-customer-offers-ui/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1251:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
at Module.load (internal/modules/cjs/loader.js:1100:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
it is asking for GLIBC_2.29 and when I ran this command:
$ strings /snap/core/current/lib/x86_64-linux-gnu/libm.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.4
GLIBC_2.15
GLIBC_2.18
GLIBC_2.23
GLIBC_PRIVATE
2.29 is not there. However, my ldconfig:
$ ldconfig --version
ldconfig (Ubuntu GLIBC 2.31-0ubuntu9.1) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
Does anyone know how to change so that it does not uses Snap or how to add GLIBC_2.29 to the Snap Core library?
Having pretty much the same problem:
Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /root/PanelBot/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/root/PanelBot/node_modules/bindings/bindings.js:112:48)
at Object.
having same issue:
it just hangs on the make
and doesnt do anything
> better-sqlite3@7.1.4 install /home/container/bot/node_modules/better-sqlite3
> prebuild-install || npm run build-release
prebuild-install WARN install /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/container/bot/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
> better-sqlite3@7.1.4 build-release /home/container/bot/node_modules/better-sqlite3
> node-gyp rebuild --release
make: Entering directory '/home/container/bot/node_modules/better-sqlite3/build'
TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
TOUCH Release/obj.target/deps/locate_sqlite3.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o```
i have same thing
Afaik this issue is caused when you build better-sqlite3
with too recent version of glibc. We ran into this with our custom version of better-sqlite3
with more prebuilds, and it was caused by GH actions switch to ubuntu 20. When we used ubuntu 16 in the build container, it helped.
Here is our version of better-sqlite3
that should work fine:
https://github.com/apify/better-sqlite3-with-prebuilds
It is just a clone of the repo with more prebuilds and inlined TS support (no changed other than that).
I have same thing, But I have no problem compiling it. This error occurred when I ran the packaged Electron application
@JoshuaWise This error also occurs when running in Electron on Debian Buster.
This only occurs during runtime
, not install time on Buster.
I can install better-sqlite3 (it uses the electron prebuilt package), but when the app runs, it has this problem.
Error: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/rathboma/Downloads/beekeeper-studio/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/home/rathboma/Downloads/beekeeper-studio/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/rathboma/Downloads/beekeeper-studio/node_modules/better-sqlite3/lib/database.js:9:24)
Seems like from #586 using version 7.1.2 might solve this temporarily?
Looks like changing the github actions pipeline to build on Ubuntu 18.04 might solve this? Not totally sure here, but it rings a bell from an earlier problem I had on my app.
Looks like changing the github actions pipeline to build on Ubuntu 18.04 might solve this? Not totally sure here, but it rings a bell from an earlier problem I had on my app.
As I already noted above, building via ubuntu 16 fixes this. Not sure if ubuntu 18 will work too, I believe not. The problem is with back compatibility, if you build with newish GLIBC, you need to have newish version to use it too. When building with the old version, it will work fine.
So Github actions supports Ubuntu 18-04 - ubuntu-18.04
, so this should be a fairly simple change to the .workflow file. I'll submit a PR when I get a minute
I am on Suse Enterprise 12 SP3 and downgrading to 7.1.2 does NOT solve the issue.
npm ERR! g++: error: unrecognized command line option ‘-std=c++14’
Any advice?
how to fix this error guys? I got this error on Centos 7, I have installed gcc, python with the following command:
sudo yum install -y python3
yum install gcc-c++ -y
yum install cmake -y
yum install centos-release-scl -y
yum install devtoolset-8-gcc devtoolset-8-gcc-c++ scl-utils -y
scl enable devtoolset-8 -- bash
I don't know if this is a bug in better-sqlite3 or in snap.
With the following minimal demo package:
I get this error:
some system info: