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
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.
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.
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 (!
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With