termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
31.28k stars 3.32k forks source link

[Bug]: Problem with node-gyp on termux #3858

Open bajrangCoder opened 2 months ago

bajrangCoder commented 2 months ago

Problem description

Error while installing node-pty(or any npm package which need node-gyp). Tried in many devices still same issue . Before it used to work . Stopped working recently. And it working fine on Linux os, Userland terminal but not on termux. I am pretty sure that it's termux specific issue.

Screenshot

Steps to reproduce the behavior.

Try to install any node-gyp package. For eg: node-pty or try to install this package:

npm i -g acodex-server

What is the expected behavior?

It should install package successfully without any issue

System information

legendSabbir commented 2 months ago

Same issue for me also . It was working just fine . Just stopped working recently . Also there is a lot of user for this . So kindly fix this issue

7HR4IZ3 commented 2 months ago

Screenshot_2024-02-25-18-24-14-503_com foxdebug acode

I was able to install it by installing 'node-gyp' separately then add argv.push('-Dandroid_ndk_path=""') the 'node_modules/node-gyp/lib/configure.js' file.

I'm manually defining the android_ndk_path variable this works because also the variable is required, it isn't actually being used, but it needed the value could be set to the actual android-ndk path.

Check out Termux NDK to install Android NDK on Termux.

bajrangCoder commented 2 months ago

Screenshot_2024-02-25-18-24-14-503_com foxdebug acode

I was able to install it by installing 'node-gyp' separately then add argv.push('-Dandroid_ndk_path=""') the 'node_modules/node-gyp/lib/configure.js' file.

I'm manually defining the android_ndk_path variable this works because also the variable is required, it isn't actually being used, but it needed the value could be set to the actual android-ndk path.

Check out Termux NDK to install Android NDK on Termux.

This isn't applicable, if you have any other solution then suggest...

7HR4IZ3 commented 2 months ago

Adding this to '~/.gyp/include.gypi' fixes the problem without the need to edit the source code.

You have to create the '.gyp' folder first.

{
    'variables': {
        'android_ndk_path': ''
    }
}
ahaoboy commented 1 week ago

same issue, https://github.com/coder/code-server, install dep https://www.npmjs.com/package/argon2 failed