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.
Description
prek installcrashes on Android (Termux) with aTypeErrorin the platform detection logic. ThegetGnuLibcVersion()function returnsnullon Android (which uses Bionic libc, not glibc), and the result is passed to.split()without a null check.Error
Environment
linux aarch64(Android 15, Termux)Expected behavior
prek installshould either:Root cause
getPlatform()inbinary.jscallsgetGnuLibcVersion()which returnsnullon non-glibc systems. The null return is not handled before calling.split(".")on line 63.