如何在 android 上运行我的 node.js 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11392590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:15:29  来源:igfitidea点击:

How to run my node.js project on android?

javascriptandroidnode.jswebserver

提问by Danny Fox

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.

我的 android 平板电脑上有一个可用的 php 服务器,所以我希望它也可以以某种方式运行 nodejs。源代码在 github 上可用,它也可以在 linux 上构建,但我无法真正理解如何构建它。

Thanks in advance,

提前致谢,

采纳答案by Ricardo Tomasi

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

  1. 下载它:

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

  2. 打开包装:

    tar xzf node-v0.8.1.tar.gz

  3. 进入解压后的文件夹:

    cd node-v0.8.1/

  4. ./configure&& make&&sudo make install

You might need to install some dependencies like g++or build-essential, curland libssl-devfirst.

您可能需要像安装一些依赖g++或者build-essentialcurllibssl-dev第一。

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

还有一个打包的 Android 端口,但似乎没有得到积极维护。

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/

编辑:显然您需要根据您的设备修改一些构建选项。谷歌搜索“node android”+您的模型应该为您提供更多详细信息。以下是 G1 和 Galaxy S:http: //mitchtech.net/node-js-on-android-linux/

回答by Paul Verest

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

截至 2015 年 9 月,https://nodejs.org/dist/latest/ 有适用于 ARM 的 Node.js 4.x 发行版