Problem in installing node-red on android

How to do it to have a different version?

You can probably use google as well as I can

You can also try an older version of node-red, On a test machine I have version 1.1.2 running on android 6x 2gb ram and 16gb storage and nodejs 13 . For some reason i had issues updating nodejs, probably take another crack when I have some spare time.

Try

npm install -g --unsafe-perm node-red@1.1.2
1 Like

thanks we made it

And I probably can't have a higher version because after typing pkg install nodejs installs to me in version 13 and I do not know how to install lower versions f.e. 12

Try this : pkg install nodejs-lts

2 Likes

after typing this command I have version 12 node and after typing

npm i -g --unsafe-perm node-red

installed the latest version for me.

How to set to node-red to start automatically after starting termux?

2 Likes

RedMobile works very well on Xiaomi Note and Galaxy tab 3.

RedMobile is a pay for app, and the free version has no pallete.

If you use the node-red installation instructions using termux you will get a better and more upto date version.

Unless they changed, the autostart for termux was a paid feature, $5 if I remember correctly. You can mostly make it work by editing .profile or .bashrc to run your commands. I gave up with it a couple of years ago as the Android phone was much less reliable than the IOT devices I was trying to monitor and send alerts about.

where can i find these files ?

To start termux with the typed command after starting the phone?

Unfortunately that may be Android version and phone provider dependent. Google it.

From the termux wiki:
Bash is the default shell after installing termux.
The BASH shell init files are ~/.bashrc , $PREFIX/etc/bash.bashrc and more. See man bash and info bash for more information.

I can't find this file and here on the forum I found such a command tsudo systemctl start node-red or tsudo systemctl enable nodered but the effect is

/system/bin/sh: systemctl: not found

But it doesn't work either so how else can I boot from termux?

Does this not work ? Termux:Boot - Termux Wiki

I downloaded Termux:Boot app and created a folder and it doesn't work

what am I doing wrong that after starting termux, node Red does not start?

or for node-red autostart you can also use pm2 on android, if so, how to configure it to be able to use the GUI version that is pm2 plus

$ pm2 startup
[PM2][ERROR] Init system not found
/data/data/com.termux/files/usr/lib/node_modules/pm2/lib/API/Startup.js:209
      throw new Error('Init system not found');
      ^

Error: Init system not found
    at API.CLI.startup (/data/data/com.termux/files/usr/lib/node_modules/pm2/lib/API/Startup.js:209:13)
    at Command.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/pm2/lib/binaries/CLI.js:707:9)
    at Command.listener (/data/data/com.termux/files/usr/lib/node_modules/pm2/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:210:5)
    at Command.parseArgs (/data/data/com.termux/files/usr/lib/node_modules/pm2/node_modules/commander/index.js:651:12)
    at Command.parse (/data/data/com.termux/files/usr/lib/node_modules/pm2/node_modules/commander/index.js:474:21)
    at Timeout._onTimeout (/data/data/com.termux/files/usr/lib/node_modules/pm2/lib/binaries/CLI.js:206:15)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

It has been quite some time since I used it, but I seem to recall starting node-red from the termux .bashrc or .profile file that runs a set of initial commands.

$ npm i -g --unsafe-perm node-red
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/cli/issues

npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2021-11-12T03_43_21_248Z-debug.log

Always getting this error and I am trying to install node red since 2 weeks now but I am not able to understand how to resolve the issue

npm -v
8.1.2
node -v
v17.1.0
~ $ npm i -g --unsafe-perm node-red
npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/cli/issues

npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2021-11-12T03_57_15_918Z-debug.log
Since 2 weeks I am trying to install and this is persistant. I am not a pro in linux env and that is why I am unable to resolve this on my own.
I just want an installation to try Node-red and then if everything works out then I'll get a RPi as a dedicated server.
Could you please tell me how to get around the error?

I suggest going back to nodejs v16 as 17 is very new and may have problems. Also possibly drop back npm to 7.

Also, running on Android can be a pain anyway. If you are just doing it to test node-red then do it on your PC or get the Pi. It will save you time in the long run.

2 Likes