github / github/node-keytar

Installation fails in Termux (Android)

Ouverte
#22 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
17
Forks
5
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
android, cpp, node.js, shell
Domaine
build-system, mobile-dev
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.