github / github/node-keytar

Installation fails in Termux (Android)

Đang mở
#22 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
17
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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."
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, cpp, node.js, shell
Lĩnh vực
build-system, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.