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

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

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 - 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...

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 :slight_smile:

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 ...)

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.

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.

1 Like

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