# Problem in installing node-red on android

**URL:** <https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638>\
**Category:** General\
**Created:** [6 June 2018 10:10 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638 "2018-06-06T10:10:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardv](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@ardv](https://discourse.nodered.org/u/ardv)\
**Post date:** [6 June 2018 10:10 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/1 "2018-06-06T10:10:59Z")

</div>

i get this error when trying to install node-red on android:  
cannot read property ‘length’ of undefined

this error shown when i type: npm i -g --unsafe-perm node-red

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2018 10:25 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/2 "2018-06-06T10:25:43Z")

</div>

Did you precede that with

```auto
pkg install coreutils nodejs

```

---

<div class="post-metadata">

**Author:** ![ardv](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@ardv](https://discourse.nodered.org/u/ardv)\
**Post date:** [6 June 2018 16:10 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/3 "2018-06-06T16:10:06Z")

</div>

i’ve preceded it with:  
apt install coreutils nano nodejs

like in this link:  
[https://nodered.org/docs/platforms/android](https://nodered.org/docs/platforms/android)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [6 June 2018 16:43 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/4 "2018-06-06T16:43:45Z")

</div>

which version of Android ? What does `node -v` and `npm -v` report back ?  
(must admit we don’t regularly test on Android - are there any more error messages than just that one line ?)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 June 2018 20:26 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/5 "2018-06-06T20:26:54Z")

</div>

Also, since you are using apt rather than pkg, run

```auto
apt update
apt upgrade

```

to make sure everything is the latest version. It probably won’t help but worth doing.

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [6 June 2018 22:52 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/6 "2018-06-06T22:52:48Z")

</div>

I did this on a cheap ($60) Blu Android 6 phone with Ting as the provider ($10/month since I do no data and no phone calls and never come close to exceeding 300 texts) and use a node red flow to monitor system status (Internet connection, AC power, heartbeat of my IOT Pi3B+ and Beaglebone etc.) and send me SMS messages when something is amiss.

Works great until some Android update makes it spontaneously reboot and it all stops until I dismiss a toast dialog ☹ Seems to happen once a month or more.

The Beaglebone which is the main MQTT broker sends an Email to inform me if the Android flow “will” message is received.

Android really needs a new settings switch – “Everything meets all my needs, don’t F’ with it!”

Here are my notes from the installation, straight from a discussion on Google Groups from about a year ago:

// From the Android Play store install:  
Termux  
Termux:API  
//  
// start the termux app and run the following commands:  
apt update  
apt upgrade  
apt install coreutils nano nodejs  
npm i -g --unsafe-perm node-red  
node-red  
apt install termux-api  
//  
// start node red in termux app:  
node-red

I made a .profile setting to autostart it, I’d have to look on the phone to see what it was as I forgot to put it in my notes, but it also came from the Google Groups discussion from back then. Termux sells an autostart app, which I was planning to buy, but so far haven’t needed to do so.

---

<div class="post-metadata">

**Author:** ![b-bilko](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@b-bilko](https://discourse.nodered.org/u/b-bilko)\
**Post date:** [7 June 2018 17:57 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/7 "2018-06-07T17:57:50Z")

</div>

I’m having the same problem.

node -v = v8.11.2  
npm -v = 5.6.0

Ran all the preceding commands.

This is the error log:

.mux/files/home/.npm/\_logs/2018-06-07T17\_52\_08\_662Z-debug.log

0 info it worked if it ends with ok  
1 verbose cli [ ‘/data/data/com.termux/files/usr/bin/node’,  
1 verbose cli ‘/data/data/com.termux/files/usr/bin/npm’,  
1 verbose cli ‘i’,  
1 verbose cli ‘-g’,  
1 verbose cli ‘–unsafe-perm’,  
1 verbose cli ‘node-red’ ]  
2 info using npm@5.6.0  
3 info using node@v8.11.2  
4 verbose npm-session 3415649d84795c1b  
5 verbose stack TypeError: Cannot read property ‘length’ of un$  
5 verbose stack at Object. (/data/data/com.term$  
5 verbose stack at Module.\_compile (module.js:652:30)  
5 verbose stack at Object.Module.\_extensions…js (module.j$  
5 verbose stack at Module.load (module.js:565:32)  
5 verbose stack at tryModuleLoad (module.js:505:12)  
5 verbose stack at Function.Module.\_load (module.js:497:3)  
5 verbose stack at Module.require (module.js:596:17)  
5 verbose stack at require (internal/module.js:11:18)  
5 verbose stack at Object. (/data/data/com.term$  
5 verbose stack at Module.\_compile (module.js:652:30)  
5 verbose stack at Object.Module.\_extensions…js (module.j$  
5 verbose stack at Module.load (module.js:565:32)  
5 verbose stack at tryModuleLoad (module.js:505:12)  
5 verbose stack at Function.Module.\_load (module.js:497:3)  
5 verbose stack at Module.require (module.js:596:17)  
5 verbose stack at require (internal/module.js:11:18)  
6 verbose cwd /data/data/com.termux/files/home  
7 verbose Linux 4.4.78-perf+  
8 verbose argv “/data/data/com.termux/files/usr/bin/node” "/da$  
9 verbose node v8.11.2  
10 verbose npm v5.6.0  
11 error Cannot read property ‘length’ of undefined  
12 verbose exit [1, true]

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 June 2018 20:24 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/8 "2018-06-07T20:24:26Z")

</div>

Which version of Android (usually in Settings \> About Phone)?

---

<div class="post-metadata">

**Author:** ![b-bilko](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@b-bilko](https://discourse.nodered.org/u/b-bilko)\
**Post date:** [7 June 2018 20:36 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/9 "2018-06-07T20:36:49Z")

</div>

I’m on a One Plus 5T running 8.1.0

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 June 2018 21:39 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/10 "2018-06-07T21:39:52Z")

</div>

can you npm install any other packages ? eg `npm i -g npm` to get the latest version of npm.

As is “usual” I have just tried a clean install on my Android tablet and it all installed fine… which doesn’t help.

But see here for a thread on this in Termux - [https://github.com/npm/npm/issues/19265](https://github.com/npm/npm/issues/19265) including possible workaround - but not a permanent fix.

---

<div class="post-metadata">

**Author:** ![b-bilko](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@b-bilko](https://discourse.nodered.org/u/b-bilko)\
**Post date:** [8 June 2018 00:04 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/11 "2018-06-08T00:04:50Z")

</div>

Interesting, I get the same error running `npm i -g npm`

I’ll take a look at the work around tomorrow, thanks.

---

<div class="post-metadata">

**Author:** ![b-bilko](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@b-bilko](https://discourse.nodered.org/u/b-bilko)\
**Post date:** [8 June 2018 00:13 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/12 "2018-06-08T00:13:46Z")

</div>

I tested the workaround, and NPM works now.

"Ha yeah that problem. I just manually edited /usr/lib/node\_modules/npm/node\_modules/worker-farm/lib/farm.js to set maxConcurrentWorkers to 1. Then npm will work again."

> <https://github.com/npm/npm/issues/19265#issuecomment-348054385>
>
> I'm opening this issue because:
> npm is crashing.
> npm is producing an incorrect install.
> npm is doing something I don't understand.
> ...

---

<div class="post-metadata">

**Author:** ![ardv](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@ardv](https://discourse.nodered.org/u/ardv)\
**Post date:** [9 June 2018 09:37 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/13 "2018-06-09T09:37:39Z")

</div>

node -v returns: 8.11.2  
npm -v returns :5.6.0  
i’m on nexus 4, android version: 8.1

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 June 2018 11:19 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/14 "2018-06-09T11:19:09Z")

</div>

It seems there is a known problem with npm on Android 8

> <https://github.com/npm/npm/issues/19170>

  
It is not clear to me from that whether there is any ongoing action to fix it.

---

<div class="post-metadata">

**Author:** ![datalin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/datalin/32/2339_2.png) [@datalin](https://discourse.nodered.org/u/datalin)\
**Post date:** [5 September 2018 08:37 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/15 "2018-09-05T08:37:44Z")

</div>

Had the same problem, fixed with typing:  
 apt-get install yarn yarn global add npm

Got the solution from here, [https://github.com/termux/termux-packages/issues/1855](https://github.com/termux/termux-packages/issues/1855)

---

<div class="post-metadata">

**Author:** ![akszyn\_pl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/akszyn_pl/32/36504_2.png) [@akszyn\_pl](https://discourse.nodered.org/u/akszyn_pl)\
**Post date:** [4 February 2021 15:04 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/16 "2021-02-04T15:04:22Z")

</div>

i have a problem with install on my xiaomi redmi note 3 pro with android 6.0.1 and this is how the installation process looks like for me [https://youtu.be/-\_Cbr-tnAvQ](https://youtu.be/-_Cbr-tnAvQ) please help because the node-red command crashes the error shown below and I do it according to [this instruction](https://nodered.org/docs/getting-started/android)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b989edfa71202a8b1aadb95964188790b40e8b34.png) ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d733e76c99fdc5a8cd882e5938abc09c3e66981.png)  
text translated by google translator

---

<div class="post-metadata">

**Author:** ![akszyn\_pl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/akszyn_pl/32/36504_2.png) [@akszyn\_pl](https://discourse.nodered.org/u/akszyn_pl)\
**Post date:** [5 February 2021 15:40 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/17 "2021-02-05T15:40:32Z")

</div>

would someone be able to help me with android installation? Because those commands didn't help

> [@datalin](#):
>
> apt-get install yarn yarn global add npm

And this command doesn't help either

> [@dceejay](#):
>
> get the latest version of npm.

Because it still pops up that no module was found

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 February 2021 16:03 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/18 "2021-02-05T16:03:17Z")

</div>

which version of nodejs is it using ?

---

<div class="post-metadata">

**Author:** ![akszyn\_pl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/akszyn_pl/32/36504_2.png) [@akszyn\_pl](https://discourse.nodered.org/u/akszyn_pl)\
**Post date:** [5 February 2021 19:10 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/19 "2021-02-05T19:10:52Z")

</div>

this is what this error looks like in its entirety

```auto
$ node-red
internal/modules/cjs/loader.js:458
  throw e;
  ^

Error: Package exports for '/data/data/com.termux/files/usr/lib/node_modules/node-red/node_modules/async-mutex' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:455:13)
    at resolveExports (internal/modules/cjs/loader.js:388:16)
    at Function.Module._findPath (internal/modules/cjs/loader.js:487:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:782:27)
    at Function.Module._load (internal/modules/cjs/loader.js:688:27)
    at Module.require (internal/modules/cjs/loader.js:850:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/api/flows.js:37:13)
    at Module._compile (internal/modules/cjs/loader.js:958:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:994:10) {
  code: 'MODULE_NOT_FOUND'
}

```

I have node 13.0.0 and npm 12.0

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 February 2021 19:39 UTC](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638/20 "2021-02-05T19:39:43Z")

</div>

Can you use one of the supported node js versions like 12 or 14 ?

[Next page](https://discourse.nodered.org/t/problem-in-installing-node-red-on-android/638.md?page=2)
