termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.32k stars 3.06k forks source link

[Bug]: typescript compiler tsc exicutable dosen't exist and npx fail to recogonize tsc #17913

Closed Ammar-Husain closed 1 year ago

Ammar-Husain commented 1 year ago

Problem description

I can't compile typescipt code neiteher with tsc file.ts nor with npx tsc file.ts

when i run tsc file.ts i get :

No command tsc found, did you mean:
 Command csc in package chicken
 Command tac in package coreutils
 Command tsh in package etsh
 Command tc in package iproute2
 Command csc in package mono
 Command ts in package moreutils
 Command psc in package n-t-roff-sc
 Command tic in package ncurses-utils
 Command ts in package task-spooler
 Command tcc in package tcc
 Command tsh in package teleport-tsh
 Command tsz in package trzsz-go
 Command tsp in package tsduck-tools
 Command tsu in package tsu

indicating that there is no tsc exicutable in the $PATH

when i try with npx tsc file.ts i get:

sh: 1: tsc: not found

i have both typescript and tsc installed in my working directory

~/.../files/typescript_test $ npm list
typescript_test@1.0.0 /storage/emulated/0/Android/data/io.spck/files/typescript_test
├── npx@10.2.2
├── tsc@2.0.4
└── typescript@5.2.2

i have even tried to install them globally but i got the same result i tried install them as dev dependencies but got the same result

What steps will reproduce the bug?

1.

pkg i nodejs
  1. npm init -y && npm i -g typescript --no-bin-links
  2. create a file and try to run it with: tsc file.ts or: npx tsc file.ts

What is the expected behavior?

file compiled successfully and file.js file generated

System information

termux-info:

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=19047
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.ustc.edu.cn/termux/apt/termux-main stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/21 termux extras
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.ustc.edu.cn/termux/apt/termux-x11 x11 main
Updatable packages:
apt/stable 2.7.6 aarch64 [upgradable from: 2.7.3]
brotli/stable 1.1.0 aarch64 [upgradable from: 1.0.9-1]
cmake/stable 3.27.5 aarch64 [upgradable from: 3.26.4-2]
command-not-found/stable 2.3.0-3 aarch64 [upgradable from: 2.2.0-14]
coreutils/stable 9.4 aarch64 [upgradable from: 9.3]
curl/stable 8.3.0 aarch64 [upgradable from: 8.2.1]
dos2unix/stable 7.5.1 aarch64 [upgradable from: 7.5.0]
libarchive/stable 3.7.2 aarch64 [upgradable from: 3.7.1]
libcurl/stable 8.3.0 aarch64 [upgradable from: 8.2.1]
libgmp/stable 6.3.0 aarch64 [upgradable from: 6.2.1-2]
libimagequant/stable 4.2.1 aarch64 [upgradable from: 4.2.0]
libnghttp2/stable 1.56.0 aarch64 [upgradable from: 1.55.1]
libopenblas/stable 0.3.24 aarch64 [upgradable from: 0.3.23]
libsqlite/stable 3.43.1 aarch64 [upgradable from: 3.42.0]
libunbound/stable 1.18.0 aarch64 [upgradable from: 1.17.1-2]
libwebp/stable 1.3.2 aarch64 [upgradable from: 1.3.1-2]
mesa/stable 23.1.8 aarch64 [upgradable from: 23.1.6]
ncurses-ui-libs/stable 6.4.20230527-1 aarch64 [upgradable from: 6.4.20230527]
ncurses-utils/stable 6.4.20230527-1 aarch64 [upgradable from: 6.4.20230527]
ncurses/stable 6.4.20230527-1 aarch64 [upgradable from: 6.4.20230527]
openssl/stable 1:3.1.3 aarch64 [upgradable from: 1:3.1.2]
perl/stable 5.38.0-1 aarch64 [upgradable from: 5.38.0]
python-numpy/stable 1.26.0 aarch64 [upgradable from: 1.25.2]
python-pandas/tur-packages 2.1.1 aarch64 [upgradable from: 2.0.3]
python-pillow/stable 10.0.1 aarch64 [upgradable from: 10.0.0]
python-pygame/tur-packages 2.5.2 aarch64 [upgradable from: 2.5.1]
rust/stable 1.72.1 aarch64 [upgradable from: 1.70.0-1]
sdl2/x11 2.28.3 aarch64 [upgradable from: 2.28.1]
sqlite/stable 3.43.1 aarch64 [upgradable from: 3.42.0]
termux-am/stable 0.6.0 all [upgradable from: 0.4]
termux-tools/stable 1.39.0 all [upgradable from: 1.38.5]
unbound/stable 1.18.0 aarch64 [upgradable from: 1.17.1-2]
termux-tools version:
1.38.5
Android version:
10
Kernel build information:
Linux localhost 4.14.116 #1 SMP PREEMPT Thu Feb 9 20:15:09 CST 2023 aarch64 Android
Device manufacturer:
HUAWEI
Device model:
BAH4-L09
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
sylirre commented 1 year ago

I would suggest working with code and NPM modules in Termux home directory.

/storage/emulated/0 does not support necessary features such as symlinks or file attributes including executables permissions.

And why you used --no-bin-links option? Without this one tsc is available.

Anyway, I'm closing the issue because it is not a bug and is not reproducible either if everything is set up correctly.

Screenshot_20230927-105522