[yocto] Yocto and NPM issues

Svein Seldal sveinse at seldal.com
Wed Mar 21 07:44:17 PDT 2018


On 21.03.2018 14:54, Alexander Kanavin wrote:
>> I'm attempting to package a npm-based js application into a Rocko 
>> image, and I'm having some issues. For testing I use the official poky 
>> repo and the meta-openembedded repo (for installing nodejs 8.4.0). I'm 
>> building for qemux86-64.
> 
> I know this is not an answer to your specific issues, but npm is a bit 
> of maintenance nightmare as its workflow (downloading random stuff off 
> the internet as an integral part of the build) clashes badly with how 
> bitbake, and embedded world in general handle builds. We've discussed 
> what to do about it, with no clear outcome, but we would like to have 
> something that doesn't require constant fixing and hacks:
> 
> http://lists.openembedded.org/pipermail/openembedded-architecture/2017-March/000480.html 

I haven't read the post in full yet, but the principle of npm is 
inherently different from the philosophies of Yocto, granted.

One approach that we've been discussing as an alternative to the 
yocto+npm approach is to install the js app on a target machine and 
snapshot the whole resulting directory hierarchy. The product validation 
is then made on the modules as a whole. The recipe would need to be a 
simple file-installer.

The problem with that is that one needs a target deployment system that 
runs npm install on the actual target in order to make the correct files 
for the target. The output from that must be plugged into the oe build 
system somehow, so there will be many moving parts in this scheme too.

 > Oh, and you might have more success using meta-nodejs, as it doesn't try
 > to implement a custom fetcher, and just runs npm directly during the
 > build. If you don't mind that that makes the build outcome essentially
 > random from one invocation to the next.
 >
 > https://github.com/imyller/meta-nodejs

The meta-nodejs repo seems to be abandoned, as it does support any newer 
versions of nodejs. I asked on #yocto and I was suggested that this 
layer wasn't really necessary as meta-openembedded supports nodejs.


Best regards,
Svein



More information about the yocto mailing list