33

I have a working php server on my android tablet, so I hope it's available somehow to run nodejs also. The source code is available on github, and it can be build on linux also, but I can't really understand, how to build it.

Thanks in advance,

Danny Fox
  • 31,515
  • 27
  • 62
  • 90
  • 1
    A less direct way could be to use Browserify to run parts of node.js projects in Webkit. – Luke Stanley Jan 02 '14 at 08:23
  • Browserifying is only viable for projects where there is little use of Node API objects. Uses of `fs.readFileSync` will quickly become a no-go for this approach (as I've found out [here](https://stackoverflow.com/q/45209191/8295283), [here](https://stackoverflow.com/q/45387803/8295283), [here](https://stackoverflow.com/q/45301900/8295283) and [here](https://stackoverflow.com/q/45084751/8295283)) Now looking to: [Viable options to running NodeJS on Android (Aug 2017)](https://stackoverflow.com/a/45649995/8295283) – Arnold Schrijver Aug 12 '17 at 15:36

2 Answers2

19

The instructions for a build are missing from the website:

  1. Download it:

    wget http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz

  2. Unpack it:

    tar xzf node-v0.8.1.tar.gz

  3. Go to the unpacked folder:

    cd node-v0.8.1/

  4. Run

    ./configure && make && sudo make install

You might need to install some dependencies like g++ or build-essential, curl and libssl-dev first.

There is also a packaged Android port but it doesn't seem to be actively mantained.

edit: apparently you need to modify some build options according to your device. A google search for "node android" + your model should give you more details. Here are they for the G1 and Galaxy S: http://mitchtech.net/node-js-on-android-linux/

Ricardo Tomasi
  • 31,690
  • 2
  • 52
  • 65
  • 1
    Thanks, but I'm a beginner, so I don't really know how to do this steps. I've searched it on google, but I haven't found any downloadable .apk file. – Danny Fox Jul 09 '12 at 11:00
  • 1
    How does one make this approach viable as a "commercially available" solution if each distribution must be configured and built for a specific device? – Tri Q Tran Mar 02 '15 at 04:31
5

As of Sep 2015 there are Node.js 4.x distributions for ARM from https://nodejs.org/dist/latest/

Paul Verest
  • 51,779
  • 39
  • 174
  • 288
  • I am not sure if these ARM releases work on Android (didn't think so). My current research: [Viable options to running NodeJS on Android (Aug 2017)](https://stackoverflow.com/a/45649995/8295283) – Arnold Schrijver Aug 12 '17 at 15:38