# Node-red-contrib-cron-plus timezone error

**URL:** <https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063>\
**Category:** General\
**Created:** [3 September 2019 14:40 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063 "2019-09-03T14:40:46Z")\
**Posts on this page:** 20\
**Page:** 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:** [3 September 2019 14:40 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/1 "2019-09-03T14:40:46Z")

</div>

I am running node-red 0.20.7, nodejs 8.11.2 in Termux on Android. When using node-red-contrib-cron-plus 0.3.0 with the timezone setting empty it shows a status of  
`Error: check timezone setting`  
Though it does appear to be using the correct timezone (GB).

If I set the timezone to GB in the node then the field in the node config shows  
`Europe/London`  
but when I Deploy it shows a red status `Error creating Job` and in the debug window it says "Error: Invalid IANA name or offset"

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 14:47 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/2 "2019-09-03T14:47:20Z")

</div>

Hi @Colin could you post a small flow demonstrating this please?

I'll take a look.

---

<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:** [3 September 2019 15:09 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/3 "2019-09-03T15:09:59Z")

</div>

It doesn't need a flow, just the node  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5aa9a8367ca698c2c2c3dc4b5838b7327110cacc.png)

```auto
[{"id":"47f10950.f6e028","type":"cronplus","z":"fcec201.12ad9e","name":"Schedule","outputField":"payload","timeZone":"","options":[{"topic":"06:00","payload":"20.0","type":"str","expression":"00 00 06 * * * *"}],"x":200,"y":320,"wires":[["ca87681c.281dc","2b0d25c4.9e7dea"]]}]

```

and if set the timezone to GB I see  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f6903fcf0795be0fa97120953c20a0224a685a43.png)

```auto
[{"id":"47f10950.f6e028","type":"cronplus","z":"fcec201.12ad9e","name":"Schedule","outputField":"payload","timeZone":"Europe/London","options":[{"topic":"06:00","payload":"20.0","type":"str","expression":"00 00 06 * * * *"}],"x":200,"y":320,"wires":[["ca87681c.281dc","2b0d25c4.9e7dea"]]}]

```

Running on Ubuntu it is ok (though that is with node 10.x)  
It is not an urgent problem as with the empty timezone it is working ok except for the status message.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 15:19 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/4 "2019-09-03T15:19:58Z")

</div>

> [@Colin](#):
>
> ```auto
> [{"id":"47f10950.f6e028","type":"cronplus","z":"fcec201.12ad9e","name":"Schedule","outputField":"payload","timeZone":"","options":[{"topic":"06:00","payload":"20.0","type":"str","expression":"00 00 06 * * * *"}],"x":200,"y":320,"wires":[["ca87681c.281dc","2b0d25c4.9e7dea"]]}]
> 
> ```

Hmmm, I dont get that on mine...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/984884a45803076475afe05e6f8bc4ecafdf74e7.png)

Guess I'll have to setup an ubuntu with node V8 + NR 20.7

Could you do a test for me?

Install the below and restart? ...

```auto
cd ~node-red
npm install full-icu

```

It may be the minimal intl support in default nodejs install

EDIT:  
[this](https://techoverflow.net/2018/09/19/fixing-nodejs-intl-datetimeformat-not-formatting-properly-for-locales/) suggests `Intl.DateTimeFormat` is node v9+

hmmm. How to fix 🤔

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 15:21 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/5 "2019-09-03T15:21:04Z")

</div>

> [@Colin](#):
>
> Running on Ubuntu it is ok (though that is with node 10.x)

Just re-read that. Looking very likely its a node v8 thing.

Wonder if its possible to check NPM version inside a custom node & handle things accordingly?

---

<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:** [3 September 2019 15:23 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/6 "2019-09-03T15:23:47Z")

</div>

Does that mean you don't need me to install full-icu?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 September 2019 15:26 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/7 "2019-09-03T15:26:31Z")

</div>

Easy to restrict install to just specific versions of nodejs in your package.json

---

<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:** [3 September 2019 15:29 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/8 "2019-09-03T15:29:42Z")

</div>

I see that node 10.x is now available in the termux repo, do you want me to try that? Not sure whether I would be able to get back to 8.x though.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 15:33 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/9 "2019-09-03T15:33:54Z")

</div>

if you could, yes please.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 15:34 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/10 "2019-09-03T15:34:44Z")

</div>

@ukmoose Thanks.

Would setting this prevent a user from installing in the NR pallete?

Could you show me how/where please?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 September 2019 15:49 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/11 "2019-09-03T15:49:43Z")

</div>

[https://docs.npmjs.com/files/package.json#engines](https://docs.npmjs.com/files/package.json#engines)

---

<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:** [3 September 2019 15:58 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/12 "2019-09-03T15:58:50Z")

</div>

Damn, I have broken my termux install trying to upgrade stuff. Apparently you can't do that with Termux.

---

<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:** [3 September 2019 16:00 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/13 "2019-09-03T16:00:35Z")

</div>

npm won't run

```auto
$ npm -v
CANNOT LINK EXECUTABLE: library "libcrypto.so.1.1" not found
page record for 0xb607c02c was not found (block_size=16)

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 16:06 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/14 "2019-09-03T16:06:35Z")

</div>

Oh dear.

Is that termux on Android?

I'm certain I got node V10 working in it on my old device (can't check right now)

---

<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:** [3 September 2019 16:17 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/15 "2019-09-03T16:17:58Z")

</div>

Yes it wanted to upgrade to 12.x but 10.x is available as nodejs-lts so I removed nodejs and installed nodejs-lts and now npm won't run. Also if I try to do a full package update then I get

```auto
E: This installation run will require temporarily removing the essential package libandroid-support:arm due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
E: Internal Error, Could not early remove libandroid-support:arm (2)

```

which google suggests mean I need to remove the app and re-install which presumably means I will need to re-install mosquitto, node red and so on.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 16:26 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/16 "2019-09-03T16:26:33Z")

</div>

Perhaps just apt install npm will be enough?

Note, as it's a node upgrade, I believe you should reinstall node\_modules anyhow (some things get compiled for specific version I believe).

Sorry to cause you grief. Appreciate you testing the node ver theory.

---

<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:** [3 September 2019 16:28 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/17 "2019-09-03T16:28:41Z")

</div>

> [@Steve-Mcl](#):
>
> Perhaps just apt install npm will be enough

There doesn't appear to be an npm package, I presume it comes with nodejs.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 September 2019 17:13 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/18 "2019-09-03T17:13:41Z")

</div>

Raised an issue [here](https://github.com/Steve-Mcl/node-red-contrib-cron-plus/issues/2)

---

<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:** [3 September 2019 20:38 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/19 "2019-09-03T20:38:29Z")

</div>

Having got my system up and running again, well more or less, I can confirm it works as it should with node.js 10.16.3 running in Termux on Android 6

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 September 2019 20:54 UTC](https://discourse.nodered.org/t/node-red-contrib-cron-plus-timezone-error/15063/20 "2019-09-03T20:54:41Z")

</div>

A little late to the conversation but as I think you've already discovered, node.js v8 at least only includes a small subset of the files.

However, there is an explanation of how to patch this here:

[https://nodejs.org/docs/latest-v8.x/api/intl.html#intl\_providing\_icu\_data\_at\_runtime](https://nodejs.org/docs/latest-v8.x/api/intl.html#intl_providing_icu_data_at_runtime)

And this somewhat dated article shows you how to polyfill though I'm not sure that's needed now anyway even with v8

[https://formatjs.io/guides/runtime-environments/](https://formatjs.io/guides/runtime-environments/)
