GLIBC_2.33 not found

Greetings!

I tried to use better-sqlite3 and it doesn’t work because it says that it needs GLIBC_2.33 in error:
VoiceStateUpdate.js Events Loaded Successfullly
guildCreate.js Events Loaded Successfullly
interactionCreate.js Events Loaded Successfullly
logger.js Events Loaded Successfullly
messageCreate.js Events Loaded Successfullly
ready.js Events Loaded Successfullly
threadCreate.js Events Loaded Successfullly
/home/runner/JUGNU-MUSIC-8/node_modules/bindings/bindings.js:121
** throw e;**
** ^**

Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33’ not found (required by /home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
** at Object.Module._extensions…node (node:internal/modules/cjs/loader:1183:18)**
** at Module.load (node:internal/modules/cjs/loader:975:32)**
** at Function.Module._load (node:internal/modules/cjs/loader:822:12)**
** at Module.require (node:internal/modules/cjs/loader:999:19)**
** at require (node:internal/modules/cjs/helpers:102:18)**
** at bindings (/home/runner/JUGNU-MUSIC-8/node_modules/bindings/bindings.js:112:48)**
** at new Database (/home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3/lib/database.js:48:64)**
** at new Enmap (/home/runner/JUGNU-MUSIC-8/node_modules/enmap/src/index.js:152:18)**
** at Object. (/home/runner/JUGNU-MUSIC-8/index.js:89:19)**
** at Module._compile (node:internal/modules/cjs/loader:1099:14) {**
** code: ‘ERR_DLOPEN_FAILED’**
}

Node.js v17.9.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jugnumusic@3.0.0 start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jugnumusic@3.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2023-07-19T13_12_40_866Z-debug.log
exit status 1
Is there any way to install GLIBC_2.33 or other versions in nix or others?

Regards,
Omar (Omarplayz233)

Hello @Omarplayz233 and welcome to the community!

Try to compile better-sqlite3 from source.

Remove the node_modules directory

rm -rf node_modules

and update your packages.json

"scripts": {
  "install": "npm install --build-from-source=better-sqlite3"
}

And then run npm install.

Tell me if it works!

3 Likes

looks like the nix channel on your repl had updated.
Running npm ci in Shell might work to recompile the package with the new glibc

3 Likes

Greetings!

I got errors while running -npm i:

 npm i
npm WARN lifecycle The node binary used for scripts is /home/runner/JUGNU-MUSIC-8/node_modules/.bin/node but npm is using /nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> better-sqlite3@8.4.0 install /home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3
> prebuild-install || node-gyp rebuild --release

prebuild-install warn install No prebuilt binaries found (target=17.9.1 runtime=node arch=x64 libc= platform=linux)
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:470:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
gyp ERR! System Linux 5.19.0-1027-gcp
gyp ERR! command "/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/bin/node" "/nix/store/rvdwqyys0nj4gw8ryxjpyz256m1wr1xd-nodejs-12.22.9/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3
gyp ERR! node -v v12.22.9
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN ts-api-utils@1.0.1 requires a peer of typescript@>=4.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN jugnumusic@3.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@8.4.0 install: `prebuild-install || node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@8.4.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-07-19T22_37_20_129Z-debug.log

Regards,
Omar (Omarplayz233)

You will need to add Python to your Nix environment in your replit.nix file.

let
  pkgs = import <nixpkgs> {};
in
  pkgs.mkShell {
    buildInputs = [
      pkgs.nodejs-19_x
      pkgs.python3
    ];
  }

But before that, did you try what @UMARismyname said?

3 Likes

Greetings!

I did tried on what @UMARismyname said.
Once again, i tried everything, updating better-sqlite3 and same error as the first one:

VoiceStateUpdate.js  Events Loaded Successfullly
guildCreate.js  Events Loaded Successfullly
interactionCreate.js  Events Loaded Successfullly
logger.js  Events Loaded Successfullly
messageCreate.js  Events Loaded Successfullly
ready.js  Events Loaded Successfullly
threadCreate.js  Events Loaded Successfullly
/home/runner/JUGNU-MUSIC-8/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (/home/runner/JUGNU-MUSIC-8/node_modules/bindings/bindings.js:112:48)
    at new Database (/home/runner/JUGNU-MUSIC-8/node_modules/better-sqlite3/lib/database.js:48:64)
    at new Enmap (/home/runner/JUGNU-MUSIC-8/node_modules/enmap/src/index.js:152:18)
    at Object.<anonymous> (/home/runner/JUGNU-MUSIC-8/index.js:89:19)
    at Module._compile (node:internal/modules/cjs/loader:1099:14) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v17.9.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jugnumusic@3.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the jugnumusic@3.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-07-20T11_05_37_342Z-debug.log
exit status 1

I checked in Stack Overflow and they said You missed GLIBC

Regards,
Omar (Omarplayz233)

It can be that the better-sqlite3 package was built with a version of the GLIBC library that’s different from the one available in Replit.

Try to run ldd --version in shell and see what your GLIBC version is.

ldd (GNU libc) 2.33
$Copyright (C) 2021 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 Roland McGrath and Ulrich Drepper.

Well…

I don’t know what to say. The version is there.

The only thing I can recommend is to try create a new project and build better sqlite3 from source again. Copy the contents of your project into a new one and try again.

well, i gotta go build using source code. And thanks for the help!
or maybe ill check in folders if there is a bug

Regards,
Omar (Omarplayz233)