"Cross compile"?

Hi

Is it possible to install Node Red on Windows to develop widgets for RPI that are then just deployed and run on the RPI?

If so, are there any tutorials for how to do this?

Thanks!

I'm not sure what "develop widgets" means, but I've taken flows developed on the Pi and moved them to Windows 10. Obviously Pi GPIO nodes and Linux exec nodes won't be available on Windows, there may be Windows nodes not available for use on the Pi, I don't do much with Windows these days.

I've found node-red portability to be outstanding I've run flows on Windows, Linux ARM, and Linux x86-64, my only issue has been the lack of exec nodes on Windows.

As long as you use the common node modules you can. But once you use nodes that are platform specific, you will have issues. Also the modules that are below the NR flows have the same issue.

1 Like

Nearly all of the nodes for Node-RED will happily work on all supported platforms (except possibly Android). But you have to compile many of them on the native platform. npm takes care of that for you.

Node.js uses C/C++ modules for performance in some cases. Examples include the serial port and crypto modules. You need the appropriate development libraries referred to as "build essentials" to allow compilation of those modules. The details are generally well hidden from us mere mortals who don't understand the dark depths of C (and don't want to thank you very much!).

If your target doesn't have Internet connectivity then you will want an equivalent platform that does. Then you can pre-compile and copy the files over somehow. I think it may be possible to cross-compile for that situation but I've no idea how.

Fortunately, the few notes that are (very) hardware specific, are special use nodes, the goal for NR has always been as @TotallyInformation noted was to make the top of NR as transparent and portable as possible. Once in while you might find that a given OS (say Windows 10) just does not do something like what Linux OSes do. But usually that is discussed in this forum at some point, or the node developer/publisher qualifies or even designs around the gap, such that you at the NR flow level may never care that under the hood some node does different things different ways for one OS or the other but presents a consistent result.