# How to cross-compile Node-RED for an embedded system

**URL:** <https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296>\
**Category:** General\
**Created:** [1 July 2020 08:40 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296 "2020-07-01T08:40:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasul](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kasul](https://discourse.nodered.org/u/kasul)\
**Post date:** [1 July 2020 08:40 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/1 "2020-07-01T08:40:45Z")

</div>

Hi everyone,

I have a question about cross-compiling Node-Red for an embedded device.  
The device is an SBC with a Touchpanel, Cortex A9 (i.MX6) processor and a Linux yocto custom build by the manufacturer.

Now I want to get Node-Red running on the embedded device, ideally without building my own yocto.  
The manufacturer included:

- a script to install Node.js (with npm) which has worked
- an SDK for cross-compiling, which I have installed on an Ubuntu 16.04 build host, worked fine so far.  
I managed to cross-compile and then run git on the embedded device (not sure if I acutally need that...) and installed grunt via npm (on the device).

Lacking some experience with npm and grunt, I am not sure how to go on with cross-compiling Node-Red from source, as it seems quite different from the tools I have been using so far (./configure and make). I didn't find any fitting results yet.

Any tips or suggestions on how to proceed?

Kind regards  
Lukas

---

<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:** [1 July 2020 09:10 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/2 "2020-07-01T09:10:53Z")

</div>

as long as the version of node.js installed is a recent version and includes npm - then you should just be able to install Node-RED using npm using the default instructions - [https://nodered.org/docs/getting-started/local](https://nodered.org/docs/getting-started/local) - as long as there is enough storage space on your device. No need to compile anything by default for the core of Node-RED. You may get some warnings about optional dependencies but they are optional...

---

<div class="post-metadata">

**Author:** ![kasul](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kasul](https://discourse.nodered.org/u/kasul)\
**Post date:** [1 July 2020 15:20 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/3 "2020-07-01T15:20:08Z")

</div>

Thank you for the quick response!  
I guess I assumed there would not be a prebuilt version for my hardware. The device has Node.js v8.11.3 and the Node-RED installation via npm worked! With some errors concerning bcrypt, which was then discarded as optional dependency as you predicted.  
So much easier than I thought 🙂

---

<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:** [1 July 2020 15:29 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/4 "2020-07-01T15:29:30Z")

</div>

ooooh - though node 8 is beyond end of life support - so no security patches or fixes. The latest node 8 is 8.17 - so if at all possible try to get to that. I know there are some nodes (eg like node-red-dashboard) that may not work on 8.11 - so fingers crossed.  
(I think the base is OK but ...)

---

<div class="post-metadata">

**Author:** ![kasul](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kasul](https://discourse.nodered.org/u/kasul)\
**Post date:** [3 July 2020 16:27 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/5 "2020-07-03T16:27:37Z")

</div>

Even the Dashboard works fine so far, which is great!  
But the Modbus package I want to use does not support this combination of Node-Red and Node.js.

And anyhow as you said it will probably be a good idea to get a newer version of Node.js installed for future support. So I will try that next.

---

<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:** [4 July 2020 12:20 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/6 "2020-07-04T12:20:19Z")

</div>

I'm afraid to say that next releases of uibuilder are not likely to be fully compatible with 8.17 I don't think the Gun.js node is either. While I do try to keep things as compatible as possible, there just isn't time available to ensure that things work so far back & as I keep dependencies up-to-date whenever a new version is released, I'm seeing dependencies switching to v10 as a minimum too which is what is prompting the change for uibuilder.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 September 2020 12:20 UTC](https://discourse.nodered.org/t/how-to-cross-compile-node-red-for-an-embedded-system/29296/7 "2020-09-02T12:20:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
