Cross-compiling Node-RED 0.10.10 on Openembedded Yocto project LINUX

915 views
Skip to first unread message

Jeff Hatch

unread,
Sep 17, 2015, 11:14:21 AM9/17/15
to Node-RED
I'm running into some difficulty building Node-RED 0.10.10 for an ARM 
architecture project.  I am trying to build using the Openembedded Yocto core
to cross-compile the firmware for the project I am working on.  There are some 
custom modifications that we have made to Node-RED, primarily adding our own 
nodes integrated for our hardware.  These changes have been integrated using 
diffs applied to the code from GitHub.  Due to these changes, I need to follow 
the development procedure:


# cd node-red

# npm install

# sudo npm install -g grunt-cli

# grunt build

# node red

Previously the build was using "npm install --production" and built 
successfully, and Node-RED would run just fine on our ARM based product.  This 
is no longer sufficient for building and running Node-RED 0.10.10 in the manner
we wish to build and install it because it appears that the build is now
generating files taht don't get created with "npm install --production".  I am 
presuming that Node-RED 0.11.1 will have the same requirement(s).  Is this 
correct?  

There is a command in the Yocto project bitbake recipes called oe_runnpm that
allows the running of npm commands in the build with the appropriate 
environment all set up.  This is not working with the "grunt build".  Whether 
grunt is installed locally or globally the following error indicating that, 
from what I can tell, grunt is using the build server architecture instead of 
the cross-compile ARM architecture occurs:

ERROR: QA Issue: Architecture did not match (40 to 62) on /work/arm926ejste-mlinux-linux-gnueabi/node-red/0.10.4-r47/packages-split/node-red/opt/node-red/node_modules/grunt-sass/node_modules/node-sass/vendor/linux-x64-11/binding.node

I am not very familiar with this grunt utility.  Is there any guidance or an
alternative that you could give me that might work to get this build to
succeed?  This error is related to grunt-sass which requires node-sass, which
requires libsass.  Is it possible that grunt-sass might not be necessary?

Thank You,

Jeff Hatch

Nicholas O'Leary

unread,
Sep 17, 2015, 11:45:32 AM9/17/15
to Node-RED Mailing LIst
Hi Jeff,

as you've noted, around node-red 0.10.10 we introduced a build step to take the code in git and build the 'executable' version. It is this executable version we publish to the npm repository, so if you simply "npm install node-red" you get a built, working install that doesn't require grunt or any of the other build dependencies.

What customisations are you making? If its simply adding nodes to the palette, there's no reason to modify the code - if you package them as npm modules (as described here: http://nodered.org/docs/creating-nodes/packaging.html) you can simply install them alongside the node-red module and they will get picked up.

If you are making modifications to the runtime source code itself, you can continue to do so, just update your patch to apply to the result of "npm install node-red" rather than the git clone.

Nick

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Hatch

unread,
Sep 18, 2015, 10:24:43 AM9/18/15
to Node-RED
Nick,

Thank you for your quick response.  I am going to create nodes and node modules for all of our node based code and add them to the "executable" version during our install.  By "install them alongside the node-red module" are you referring to installing them in the nodes and node_modules directory?  I don't think that I will be able to put the nodes and node modules out on github at this time.  The way that things were "modified" in our build/deploy environment previously, they created a repo with the nodes and node modules in the node-red repo, right along side all the "stock" nodes and node modules.  This worked, but gets messy when we want to do an upgrade of the base node-red package.

Thank you again for the recommendation.

Jeff

Dave C-J

unread,
Sep 20, 2015, 1:08:21 PM9/20/15
to Node-RED
Jeff
no need to put them "out" on Github if you don't want to. However if you do wrap them properly (as if you were going to) - http://nodered.org/docs/creating-nodes/packaging.html
then use
npm pack
locally it will create a tgz - that you can keep locally and then use
npm install {your_packed_node}.tgz
or
npm install http://{your build server}/{some directory}/{your packed node}.tgz

hopefully that will help.

Jeff Hatch

unread,
Sep 23, 2015, 9:39:30 AM9/23/15
to Node-RED
Thanks Dave.  I think our code is a ways from prime time for posting it to github (too many couplings with our hardware at this time), but at least we can be prepared in case we ever do.

Jeff
Reply all
Reply to author
Forward
0 new messages