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 摘要。