Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js npm on Android

I built node.js for android and it is running great.

Now i need some modules for a new project (serialport,express,socket.io) but I can't use npm on my android device, since i cross compiled node and just put the executable on the device.

Is there a way to use npm on android or what would be the best way to do it?

I also tried building the packages on an arm qemu but the modules weren't working o the android box.

What I am trying to do at the moment is including the modules as core modules when building node, but I am unsure what to include. All modules and all the modules that those modules depend on, etc. etc. This doesn't sound right?

I am following these instructions, that were for a similar problem: https://github.com/mapbox/node-sqlite3/wiki/Building-for-Android

What would be the best way to achieve it?

Kind regards, egon

like image 307
IngoAlbers Avatar asked May 22 '14 14:05

IngoAlbers


People also ask

Can I run NPM on Android?

Install Node and NPM on Android with Termux js and NPM on Android. You can start developing and installing new dependencies or packages with npm install. Now I will give you an example of an app to prove that the installation of node and NPM really works.

CAN node JS run on Android?

Node. js for Mobile Apps is a Node. js runtime that runs on Android and iOS, using the V8 JavaScript engine. It is very similar to a Linux build of Node, but with a few platform-specific tweaks and fixes.

How do I update NPM on Termux?

Make sure you've first installed the termux-api on your Android device from the Play store. Then install the scripts with apt install termux-api. Finally get this node module: $ npm install --save termux Example usage const api = require('termux') if (!

Can you make Android apps with node js?

Android JS provides Node JS runtime environment, So you can write your code in Node. JS and can use any `npm` package which helps to build your app in a quick way.


1 Answers

I played with termux (https://play.google.com/store/apps/details?id=com.termux&hl=en_US). In terminal you can install node.js and npm. I installed some packages from npm storage. Seems I did not found any problem. Especially if we are using samsung dex station.

ps probebly I downloaded modules via git from github. Not sure about npm.

like image 75
Yaroslav Gaponov Avatar answered Oct 06 '22 01:10

Yaroslav Gaponov