Skip to content

Support running on Android/Termux: bcrypt fails to compile #45

@melvincarvalho

Description

@melvincarvalho

Summary

JSS can run on Android via Termux + PM2, but the native bcrypt module fails to compile due to missing Android NDK configuration.

Environment

  • Platform: Android (Termux)
  • Node.js: v24.11.1
  • Architecture: arm64

Error

gyp: Undefined variable android_ndk_path in binding.gyp while trying to load binding.gyp
gyp ERR! configure error

Workaround

Replace bcrypt with bcryptjs (pure JS implementation):

npm uninstall bcrypt && npm install bcryptjs
sed -i "s/import bcrypt from 'bcrypt'/import bcrypt from 'bcryptjs'/" src/idp/accounts.js

Proposal

Consider one of:

  1. Optional dependency: Make bcrypt optional and fall back to bcryptjs when native compilation fails
  2. Switch to bcryptjs: Use bcryptjs by default (slower but portable)
  3. Document workaround: Add Termux/Android installation instructions to README

Notes

  • JSS runs well on Android once this is resolved (~95MB RAM)
  • PM2 works correctly for process management
  • Useful for self-hosting on spare phones

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions