Skip to content

prek install crashes on Android/Termux (libc version detection) #1918

@gtbuchanan

Description

@gtbuchanan

Description

prek install crashes on Android (Termux) with a TypeError in the platform detection logic. The getGnuLibcVersion() function returns null on Android (which uses Bionic libc, not glibc), and the result is passed to .split() without a null check.

Error

/node_modules/@j178/prek/binary.js:63
      let splitLibcVersion = libcVersion.split(".");
                                         ^

TypeError: Cannot read properties of null (reading 'split')
    at getPlatform (binary.js:63:42)
    at getPackage (binary.js:97:20)
    at run (binary.js:118:19)

Environment

  • Platform: linux aarch64 (Android 15, Termux)
  • Node.js: v24.13.0
  • prek: 0.3.8

Expected behavior

prek install should either:

  • Fall back gracefully when libc version can't be detected (e.g., try musl or report an unsupported platform)
  • Provide a clear error message that the platform is unsupported

Root cause

getPlatform() in binary.js calls getGnuLibcVersion() which returns null on non-glibc systems. The null return is not handled before calling .split(".") on line 63.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions