How to use Node.js in Colibri iMX6 running Linux

Hello everybody,

I recently acquired a Colibri i.MX6 with a Colibri Evaluation Board, and I’m looking to use Node.js on it as a framework to run my application. How can I get Node running in the Colibri i.MX6(working OS is Linux)?

Further in my project development I will also need to use customized hardware, it would be really helpful if some of you could point me some guides/instructions on how to communicate between Node and my device drivers.

thanks in advance

Did you also had a look at the following post in the community?

nodejs can be installed with opkg.

If you will use the node-serialport you will need write a openembedded recipe to compile node-serialport for imx6.

As @sanchayan.maity mentioned, you may want to reference this other question thread: How to implement Node.js in T30 - Technical Support - Toradex Community.

Node & NPM can easily be installed with the package manager:

opkg update
opkg install nodejs nodejs-npm

Then you can try to install the node serialport using NPM:

npm install serialport2

Using this driver in your javascript code, you’ll want to open one of the iMX6’s UARTs /dev/ttymxc[0-4]:'/dev/ttymxc1', ....)

If a node module is not available for some hardware interface you’d like to access, you may be able to use the Node.js Foreign Function Interface: GitHub - node-ffi/node-ffi: Node.js Foreign Function Interface.