Supabase CLI Error: GLIBC_2.32/GLIBC_2.34 Not Found, error: attribute 'supabase-cli' missing

Description of the problem (please keep it simple and short):
I’m trying to install and use the Supabase CLI via Replit and getting errors no matter what I try.

Explain what you were trying to do:

Each time I try to invoke the CLI, I am greeted with the following error:

> yarn add supabase && yarn run supabase
/home/runner/RewardingMindlessBackup/node_modules/.bin/supabase: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/runner/RewardingMindlessBackup/node_modules/.bin/supabase)
/home/runner/RewardingMindlessBackup/node_modules/.bin/supabase: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/runner/RewardingMindlessBackup/node_modules/.bin/supabase)

My replit.nix file:

{ pkgs }: {
  deps = [
    pkgs.nodejs-18_x
    pkgs.nodePackages.typescript-language-server
    pkgs.yarn
    pkgs.replitPackages.jest
    
    # I added these based off of other forum suggestions to no avail
    pkgs.glibc
    pkgs.coreutils
    pkgs.clang_12
    pkgs.ccls
    pkgs.gdb
    pkgs.gnumake
    pkgs.git
  ];
}

I’ve tried with three different templates:

I’ve also tried adding the pkgs.supabase-cli Nix package, but that causes different errors:

Detected change in environment, reloading shell...
nix error: building nix env: exit status 1
Output has been trimmed to the last 20 lines
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/data/misc/tzdata/tzdata-setup-hook.sh' -> '/nix/store/3q9vpdf0bqlbqr3s867nisz8phx4c9kb-tzdata-setup-hook.sh'
instantiated 'tzdata2022f.tar.gz' -> '/nix/store/p04w1xzq4h90yj9075f8j09k84isrkkh-tzdata2022f.tar.gz.drv'
instantiated 'tzcode2022f.tar.gz' -> '/nix/store/98gqjya2r5a3c8b559vnbns3c5h6bcfy-tzcode2022f.tar.gz.drv'
instantiated 'tzdata-2022f' -> '/nix/store/5yajl4zbl5sfhlqdmgw6lx9f7gaz9r0r-tzdata-2022f.drv'
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/development/interpreters/python/cpython/mimetypes.patch' -> '/nix/store/lpfs02z2i2hamz9f50p4bz6v0fs0600j-mimetypes.patch'
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/development/interpreters/python/sitecustomize.py' -> '/nix/store/kclys2xfrg0zjmpa37gyp33nyg1c7j0q-sitecustomize.py'
evaluating file '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/data/misc/mailcap/default.nix'
instantiated 'mailcap-2.1.53.tar.xz' -> '/nix/store/1sl3blsf20fdls81kg8cfiqlfb4rbifv-mailcap-2.1.53.tar.xz.drv'
instantiated 'mailcap-2.1.53' -> '/nix/store/kiay4l63r07m0z1f3kwhlyw159cjy2df-mailcap-2.1.53.drv'
instantiated 'python-setup-hook.sh' -> '/nix/store/pnk6q6z0019w8xlf730axh1vzqwzqgd4-python-setup-hook.sh.drv'
instantiated 'Python-3.10.8.tar.xz' -> '/nix/store/6m0bpccyf8gasvs6m2iw0vdfkci5i9vb-Python-3.10.8.tar.xz.drv'
instantiated 'python3-3.10.8' -> '/nix/store/kxfzn11kf6nh0igzsgfm72zfxj77lsda-python3-3.10.8.drv'
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/development/web/nodejs/disable-darwin-v8-system-instrumentation.patch' -> '/nix/store/cqn0y2wklslppakf9zwrwm6c139mh9dj-disable-darwin-v8-system-instrumentation.patch'
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/development/web/nodejs/bypass-darwin-xcrun-node16.patch' -> '/nix/store/z3xpyq84lw3ij13g0g3khcy136da1g7g-bypass-darwin-xcrun-node16.patch'
copied source '/nix/store/l6smcclpy9f3v562q2ljb9zjdswg3ma1-nixpkgs-22.11-src/pkgs/development/web/nodejs/setup-hook.sh' -> '/nix/store/ay9ps6p97mf12nybf9d4r3nyina81b87-setup-hook.sh'
instantiated 'node-v16.18.1.tar.xz' -> '/nix/store/c374bm8n4nw4an5kqf46ldsyfr8k4wwm-node-v16.18.1.tar.xz.drv'
instantiated 'nodejs-16.18.1' -> '/nix/store/5fbfpbzbzs4pgirnx8nz5i8s93ydva35-nodejs-16.18.1.drv'
error: attribute 'supabase-cli' missing, at /home/runner/GiganticAdmiredMineral/replit.nix:6:9

What areas or features are involved?

Replit shell with Nix.

Hi @Nezteb thanks for your post and welcome to the community.

Sorry for the delay in responding to this and your other query.

Can you let me know if you used one of the Supabase templates available when creating a new Repl?

image

If not please try this as it may help resolve those issues.

Hi Ian!

Yep! I listed the 3 templates I tried, Supabase.js (Database) being one of them. I haven’t tried the Python one, mostly because my project is using Node/Deno/Typescript. :smile:

1 Like

As an update, I was able to get this working last night! I’ll explain in detail in case it helps anyone else.

I naively thought that I could just yarn add/npm install global packages. With Nix that is not the case. Those are built with different dependencies and can’t be magically “linked” to existing Nix packages. There is a special nodePackages namespace for many of the common packages.

Instead, I realized I needed to install the Supabase CLI via Nix as well: NixOS Search

However, currently Replit seems to default to using an old Nix channel that doesn’t have the Supabase CLI:

# .replit
[nix]
channel = "stable-22_11"

I learned that Nix channels are named for the year/month they were released, so that one is from November 2022. So, following the Replit Nix docs, I bumped this to the latest version:

# .replit
[nix]
channel = "stable-23_05"

However, this does cause packages like pkgs.replitPackages.jest to break because they don’t exist in the latest channel. In fact, I couldn’t find any replitPackages on either the 22.11 channel or the latest channel. So I’m guessing Replit injects some packages of its own? There are docs that mention this, but they don’t explain how those packages are distributed. Using a method similar to what the Replit docs mention for fetching other versions of software, I could kind of work around this using nixpkgsfetchFromGitHub function: (I didn’t realize initially that Nix and nixpkgs offer a different set of functionality like this initially)

{ pkgs }:
let
  inherit (pkgs) lib;

  new_pkgs = import (pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "34bfa9403e42eece93d1a3740e9d8a02fceafbca"; # Some newer rev that has supabase-cli in it
    sha256 = lib.fakeSha256; # TODO: Replace me with actual hash (Nix will give you an error with the expected hash, copy paste that here)
  }) { };

  supabase-cli = new_pkgs.supabase-cli;
in
{
  deps = [
    # This wouldn't work by itself:
    # pkgs.supabase-cli

    # But this will work now that we've pulled it from a newer revision:
    supabase-cli
    
    pkgs.nodejs-18_x
    pkgs.nodePackages.typescript-language-server
    pkgs.yarn

    # And now this will work to:
    pkgs.replitPackages.jest
  ];
}

So now I can stay on the old 22.11 channel while still being able to install and use the Supabase CLI!

3 Likes

Fantastic! I’m so glad you managed to get it working @Nezteb . Also huge thanks to you for posting your solution so that others looking to do this / similar in the future can find a guide here.

Have a lovely day!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.