better-sqlite3: Installation error: version `GLIBC_2.29' not found

I don’t know if this is a bug in better-sqlite3 or in snap.

With the following minimal demo package:

/tmp/MtBBdL$ cat package.json
{
  "name": "demo",
  "version": "0.0.1",
  "main": "demo.js",
  "dependencies": {
    "better-sqlite3": "^7.0.1"
  }
}
/tmp/MtBBdL$ cat demo.js       
const Database = require('better-sqlite3');

I get this error:

/tmp/jwbayK$ node demo.js 
/tmp/jwbayK/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/jwbayK/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1250:18)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at bindings (/tmp/jwbayK/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/tmp/jwbayK/node_modules/better-sqlite3/lib/database.js:9:24)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)

some system info:

Ubuntu 19.10, linux 5.3.0-53-generic x86_64
snap info node:  14/stable:        14.3.0                         2020-05-19 (2752) 30MB classic
Package: libc6                           Version: 2.30-0ubuntu2.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

i have same thing

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?

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

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).