Gunjan Kumar
Gunjan Kumar

Reputation: 677

How to run Nodejs runtime on android or ios mobile devices

I am trying to develop one chrome-cast app for iOS/android using Ionic Framework and for that I need few NodeJS packages in my app. It is working from my desktop but I'm not sure how it will run on mobile devices where there is no Node run time available. So the first question is how to install or provide NodeJS run-time on iOS/Android devices and later if it is possible to package with iOS/Android app package.

Upvotes: 12

Views: 27854

Answers (6)

Prashant G
Prashant G

Reputation: 4900

Updated 2020 answer

All node packages don't require node runtime to be present. Some can be run on browsers as well. Example. lodash.

If you are building an application using the Ionic framework, you should be able to install node packages without any issues. However, some of the packages require OS to run. In that case, you might wanna evaluate if it makes sense to delegate that responsibility to an API endpoint.

If you absolutely need a Node runtime on your mobile app, you can use this library (nodejs-mobile).

Related read: Running Node.Js on Android

Upvotes: -5

Ari
Ari

Reputation: 7556

Best way to run NodeJS (and other things like Python, gcc, etc) on Android is through Termux which gives you a full-on Linux terminal. I'm surprised nobody has put the link here yet. (no affilications with me)

It also gives you APIs to access GPS and send notifications which you can call through your NodeJS script.

I have used it to run various nodejs apps on my Android phone, including this one.

Upvotes: 2

Eric Lange
Eric Lange

Reputation: 1783

You can run Node on iOS and Android with LiquidCore.

LiquidCore enables Node.js virtual machines to run inside Android and iOS apps. It provides a complete runtime environment, including a virtual file system and native MySQL support.

LiquidCore is a full port of node 8.9+ and supports all the bells and whistles. On iOS, its magic comes from a translation layer called V82JSC, which does exactly what it sounds like. V8 calls are translated at runtime to Apple's own JavaScriptCore which allows Node to be compiled with changing virtually no code in Node. This enables newer versions of Node to be ported quickly and with fewer bugs.

Upvotes: 2

Alexis Campailla
Alexis Campailla

Reputation: 1044

You can use Node.js for Mobile Apps.

At its core, the project provides a native library for embedding Node.js into native Android and iOS applications; but it also comes with plugins for React Native and Cordova.

Pre-built binaries for the library are available for Android armeabi-v7a, x86, arm64-v8a, x86_64, and for iOS 64-bit.

More information, including some documentation, is available on the project website.

(Full disclosure: I work for the company that develops Node.js for Mobile Apps.)

Upvotes: 10

Idrees Khan
Idrees Khan

Reputation: 7752

Someone tried running Node-Chakracore (MS Edge Browser Engine) on iOS. You can find the article on Microsoft blog. And here is the link to YouTube video.

Upvotes: 0

Zeus
Zeus

Reputation: 140

You can use JXCore to run Node.js with Express on mobile devices with PhoneGap, here is a link of a tutorial and more details about JXCore: https://www.sitepoint.com/how-to-run-node-js-with-express-on-mobile-devices/

Upvotes: 6

Related Questions