Cannot install JS modules in IMX Honister image

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot install JS modules in IMX Honister image

1,800 Views
Tuitor
Contributor I

Hello,

We acquired a i.MX 8M Nano EVK Board some weeks ago, and we would like to run some node.js applications on it for evaluation (mainly Node-RED). I have followed the procedure described in i.MX Linux User's Guide to build two images with Yocto (Honister, imx-5.15.5-1.0.0.xml, imx-image-core), one to be downloaded to SD card using uuu, and the other one for quemuarm. This works very well, and I am able to add recipes/layers to my image. In particular, I have added node.js-16.11.1 which brings npm.

My problem is that I never succeeded to install any JS package by npm. I tried Node-RED, cute-files (example of Yocto documentation), and others. I created the recipes by devtool (both methods: registry and github) but dependencies are not managed correctly, and 'devtool build' always fails. I imported several versions of recipes from meta-iot-cloud, but bitbake always ends-up with ENOTCACHED error. Of course, I searched solutions on the internet, but I couldn't find any. One commit message seems to say that something is wrong with new versions of npm, so I tried to downgrade node.js to v14, but then, this created too many compatibility issues. I am not giving all details of what I tried, but I'm starting to run out of idea

Has anybody managed to install JS modules in an IMX Honister image ?

Is it recommended to use an older version of Yocto ?

Thank you for any tip / help

0 Kudos
Reply
3 Replies

1,749 Views
zohanlin
Contributor IV

I have the same isuue in  Yocto Project 3.4 (Honister). with i.mx6ull.

And I found if I install commander package and it doesn't have any dependencies package, it would build completely.

I install other package like node-ble or cute-files which has dependencies packages , the npm would issue the error "npm ERR! code ENOTCACHED".

0 Kudos
Reply

1,772 Views
Tuitor
Contributor I

Yes, I first added node.js like you suggest:

IMAGE_INSTALL:append = "nodejs" 
IMAGE_INSTALL:append = "nodejs-npm" 

... but actually, node.js layer alone is enough because npm comes with it, so I am finally keeping this line only:

IMAGE_INSTALL:append = "nodejs" 

 

Yes, Honister supports node.js v14, but imx layers upgrade node.js to v16.

I removed the v16 upgrade to try out node.js v14, but I faced compatibility issues with other components during the build (ex: openssl). I started to fix those compatibility issues one by one, but I gave up because it was never ending. That's when I decided to ask some help on this forum.

In parallel, I've built a complete new image based on Hardknott which supports node.js v12:

repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml

... and Node-RED installation (import recipe from meta-iot-cloud) succeeded at my first attempt.

My conclusion is that installation of JS modules with npm, coming with node.js v16, brought by imx images based on Honister, does not work. I don't know exactly where or when this has been broken, but I would recommend images based on Hardknott.

(by the way, I think I posted this question in wrong forum section, I should have posted it in Software Forums, sorry about that)

0 Kudos
Reply

1,781 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Did you add nodejs like this?

 

 

IMAGE_INSTALL:append = "nodejs" 
IMAGE_INSTALL:append = "nodejs-npm" 

 

honister supports nodejs v14 and you just need append it.

http://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/nodejs?h=honister

 

 

0 Kudos
Reply