Error executing Node.js via nvm: "Check the interpreter or linker?"
Description:
I'm encountering an issue when trying to execute Node.js installed via nvm in Termux. Despite the file being present and marked as executable, the command fails with the following error:
exec: Failed to execute process '/data/data/com.termux/files/home/.local/share/nvm/v22.9.0/bin/node': The file exists and is executable. Check the interpreter or linker?
Steps to Reproduce:
-
Install
nvmusingfisherin Termux (Fish shell):fisher install jorgebucaran/nvm.fish -
Use
nvmto install Node.js:nvm install latest -
Attempt to check the Node.js version:
node -v -
The error occurs:
exec: Failed to execute process '/data/data/com.termux/files/home/.local/share/nvm/v22.9.0/bin/node': The file exists and is executable. Check the interpreter or linker?
Expected Behavior:
The node -v command should correctly return the installed Node.js version.
Actual Behavior:
The command fails with the error message about the interpreter or linker.
Additional Information:
- Termux version:
Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=11475
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.medzik.dev/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.43.6
Android version:
10
Kernel build information:
Linux localhost 4.14.116 #1 SMP PREEMPT Mon Oct 16 19:13:50 CST 2023 aarch64 Android
Device manufacturer:
HUAWEI
Device model:
STK-L22
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
-
nvm version:
nvm, version 2.2.16 -
Fish version:
fisher, version 4.4.5 -
Architecture:
arm64
Troubleshooting Attempts:
- Reinstalled Node.js via
nvm(same result). - Attempted with both
latestandltsversions (v22.9.0andv20.18.0). - Installed Node.js directly via
pkg(this works correctly).
Notes:
It seems the binary downloaded by nvm might not be compatible with Termux's environment or requires specific linkers or libraries not available in Termux by default.
Does it work outside of Termux? (Sorry if the question doesn't make sense... I'm not too familiar with Termux).
Ping @devxpain