Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run on termux due to old node.js version - why using ^12.13.1 or how to run locally on android? #962

Open
danielkrajnik opened this issue Jun 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@danielkrajnik
Copy link

danielkrajnik commented Jun 21, 2023

Describe the bug
package.json requires version 12. This won't work on termux. Binary distribution is no longer supported: curl -fsSL https://deb.nodesource.com/setup_12.x | bash - && pkg install nodejs won't work and because termux uses $PREFIX same as nvm, nvm is unavailable to downgrade.

If there is another way to run organice on android please let me know.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/200ok-ch/organice
  2. cd organice
  3. yarn install
  4. See error

Expected behavior
Use nodejs 20.2.0

Smartphone (please complete the following information):

  • Device: google Pixel 6
  • OS: GrapheneOS
@danielkrajnik danielkrajnik added the bug Something isn't working label Jun 21, 2023
@danielkrajnik
Copy link
Author

danielkrajnik commented Jun 21, 2023

I've tried changing version in package.json to 20.2.0 and running yarn install, but it kept failing.
Trying to build node version 12.13.1 from source now...
...and failing:

../deps/v8/src/base/debug/stack_trace_posix.cc:34:10: fatal error: 'execinfo.h' file not found

yep, confirmed that you can't compile nodejs on android.

Tried grabbing a nodejs 12 .deb package from debian, but it won't be installed because it has unresolved dependencies:
https://debian.pkgs.org/12/debian-main-arm64/nodejs_18.13.0+dfsg1-1_arm64.deb.html

by the way version 12 isn't supported anymore?

I thought about running it in a docker container, but it requires qemu and seems too much just to run organice.

Other options: proot or packaging it as a native client with something like react native or flutter. Keep trying...

How about webpack? Could it be packaged as a bundle of static content and served from temux from a regular http server? This sounds like the simplest and most secure solution.

@danielkrajnik danielkrajnik changed the title Can't run on termux due to old node.js version Can't run on termux due to old node.js version - why using node ^12.13.1? Jun 21, 2023
@danielkrajnik danielkrajnik changed the title Can't run on termux due to old node.js version - why using node ^12.13.1? Can't run on termux due to old node.js version - why using ^12.13.1? Jun 21, 2023
@danielkrajnik danielkrajnik changed the title Can't run on termux due to old node.js version - why using ^12.13.1? Can't run on termux due to old node.js version - why using ^12.13.1 and how to run locally on android? Jun 22, 2023
@danielkrajnik danielkrajnik changed the title Can't run on termux due to old node.js version - why using ^12.13.1 and how to run locally on android? Can't run on termux due to old node.js version - why using ^12.13.1 or how to run locally on android? Jun 22, 2023
@branch14
Copy link
Member

Hi @danielkrajnik, first of all let me express my admiration of your bravery. :)

Secondly, May I ask what your use case is for running organice within Termux?

Organcie is a PWA with offline capabilities which syncs to a storage backend of your choosing when online. If you just want to use organice on your phone pointing a browser to any instance e.g. https://organice.200ok.ch should be enough.

If you have a use case for hosting a PWA within Termux on an Android device consider me intrigued. I'd love to hear about it.

@munen
Copy link
Collaborator

munen commented Jun 22, 2023

Hi @branch14

thanks for chiming in. Op wants to access local files. There’s prior art and documentation on how to run organice in Termux with a local WebDAV server to accomplish that: https://github.com/200ok-ch/organice/tree/master/contrib

@branch14
Copy link
Member

IC. Nevermind my patronizing scrutiny then. :)

@danielkrajnik
Copy link
Author

danielkrajnik commented Jun 22, 2023

Thanks both:
@munen I haven't seen this guide. The version it mentions is outdated and because termux only offers the latest version of node, which as of june 2023 is 20.2.0 it won't work at all. But then it mentions building termux repositories yourself - I haven't tried that yet. I imagine that you would need to cross-compile that version of node for android. It's definitely doable, but if it ever changes you will need to do it again, so I wonder if given that organice is a client-side SPA wouldn't it be possible to just bundle it with something like webpack and serve its html, css and js with another http server (on localhost)? That would be much easier.

@branch14 I'm trying to self host the app and use local files. The idea was to serve them with a webdav server (dufs). I think it's important to be able to self-host if you care about privacy. There has been a fork that allowed for direct access to local storage, but I couldn't find out how to build it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants