github / github/node-keytar

Installation fails in Termux (Android)

未關閉
#22 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
17
分支
5
PR 合併指標
30 天內沒有已合併 PR

描述

### Description
Attempting to install `node-keytar` globally (`npm install -g keytar`) on Termux (Android) fails due to missing build-time dependencies and the lack of prebuilt binaries for this architecture.

### Reproduction Steps
1. Open Termux on Android.
2. Run `npm install -g keytar`.

### Expected Behavior
Successful installation and compilation of the native module.

### Actual Behavior
The installation fails with:
`Error: Cannot find module 'node-addon-api'`

And subsequently:
`gyp: Call to 'node -p "require('node-addon-api').include_dir"' returned exit status 1 while in binding.gyp.`

### Workaround
The following steps allow successful installation on Termux:
1. Clone the repository.
2. `npm install` (to install dependencies like `node-addon-api`).
3. `npm run build` (to compile the native module).
4. `npm install -g . --ignore-scripts` (to install globally, bypassing unnecessary re-compilation).

A script to automate this is attached below for reference:

```bash
#!/bin/bash
# Install node-keytar globally from current directory

echo "Installing dependencies..."
npm install

echo "Building native module..."
npm run build

echo "Installing globally..."
npm install -g . --ignore-scripts

echo "Done."
```

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing `npm install -g keytar` in Termux and inspect `binding.gyp` together with the npm install and build entry points. Compare the failing dependency lookup with the documented `npm install`, `npm run build`, and global-install workaround; done means the documented global installation succeeds on Termux without that workaround.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, cpp, node.js, shell
領域
build-system, mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
需要釐清
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。