bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun not running in termux

Open Armanidrisi opened this issue 1 year ago • 11 comments

I've installed the bun in termux using curl -fsSL https://bun.sh/install | bash and added export BUN_INSTALL="$HOME/.bun" export PATH=$BUN_INSTALL/bin:$PATH on .bash_profile file at home directory but when is try to run bun i found error bash: /data/data/com.termux/files/home/.bun/bin/bun: cannot execute: required file not found

Armanidrisi avatar Sep 12 '23 11:09 Armanidrisi

bun linked against glibc, so you should use termux glibc enviroment

pkg i pacman pacman-key --init pacman-key --populate pacman -Syu pacman -S gpkg-dev grun --set bun grun --shell ./bun install --backend=copyfile glob

--backend=copyfile shouldbe used because hardlinks are not allowed by selinux

romanovj avatar Sep 12 '23 12:09 romanovj

When I try to run pacman -S gpkg-dev I get error: target not found: gpkg-dev

Sourdface avatar Nov 12 '23 01:11 Sourdface

When I try to run pacman -S gpkg-dev I get error: target not found: gpkg-dev

now it's

yes | pkg upg
pkg i pacman patchelf -y
pacman-key --init
pacman-key --populate
pacman -Syu
pacman -Sy glibc-runner --assume-installed bash,patchelf

romanovj avatar Nov 12 '23 07:11 romanovj

While I was attempting to solve this I tried adding a line to $PREFIX/etc/pacman.d/serverlist

Server = https://service.termux-pacman.dev/gpkg-dev/$arch

and then tried your original instructions. It told me I file conflicts, so used --overwrite "*" to try to resolve them. Now I think my termux might be corrupted. If I try your updated instructions then I get warnings that local versions are newer than gpkg versions, and when I run grun it says Error: binary not found.

Any idea how to undo the damage?

Sourdface avatar Nov 12 '23 13:11 Sourdface

You can install the Debian distribution on Termux, working for me!

https://github.com/denoland/deno/issues/4862#issuecomment-1049502951

image

hoangpq avatar Dec 28 '23 09:12 hoangpq

How?

Armanidrisi avatar Dec 28 '23 12:12 Armanidrisi

@Armanidrisi check the comment https://github.com/denoland/deno/issues/4862#issuecomment-1049502951

# If you already have a PRoot distro set up you can just login to it and skip to the 3rd command.
apt update && apt install proot-distro -y
proot-distro install debian && proot-distro login debian

curl -fsSL https://bun.sh/install | bash
bun --version

hoangpq avatar Dec 29 '23 08:12 hoangpq

Thanks 😊

Armanidrisi avatar Dec 29 '23 08:12 Armanidrisi

Please reopen. The goal should be that it runs in native termux.

Jak2k avatar Jan 07 '24 10:01 Jak2k

wheres the status at on this? whats not working and what strategies are? Im interested enough to maybe convince myself to do it for you

j-refs avatar Jan 19 '24 09:01 j-refs

I made a shell script termux-pacman-glibc-setup.sh to setup glibc-runner with pacman on Termux and install Deno.JS and Bun.JS as a demo.

CodeIter avatar May 16 '24 19:05 CodeIter

@RiskyMH This is not a duplicate issue of #8685 which is a workaround for using bun in termux using glibc while this #5085 is for native bun package in termux.

n-ce avatar Jan 31 '25 04:01 n-ce

oh I see, my bad

RiskyMH avatar Jan 31 '25 04:01 RiskyMH