cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Node.js on the STM32MP1

JWali
Associate II

Any recommendations on how to install Node.js on OpenSTLinux / OpenEmbedded?

I want to run some node.js applications on the A7 processor.

I found this repository but there has been no activity for a few years.

https://github.com/imyller/meta-nodejs

13 REPLIES 13
Olivier GALLIEN
ST Employee

Hi,

Using Yocto layer is the right way to go :

https://wiki.st.com/stm32mpu/wiki/How_to_integrate_an_external_software_package

I can not comment about the package itself, but it looks properly supported byt the community :

https://layers.openembedded.org/layerindex/branch/master/layer/meta-nodejs/

Hope it help

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
JWali
Associate II

@Community member​  - Thanks for the tip. I read through https://wiki.st.com/stm32mpu/wiki/How_to_integrate_an_external_software_package and want to install the layer / recipe for Node.js - https://layers.openembedded.org/layerindex/branch/master/layer/meta-nodejs/

I read through https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_distribution and https://wiki.st.com/stm32mpu/wiki/How_to_create_a_new_open_embedded_layer

I also read https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package

Do I really need to cross-compile the entire OpenSTLinux_distribution and create an image to add the node.js layer?

-- John

gokhannsahin
Associate II

I too have a error about nodejs while installing meta-iot-cloud.

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 6 BUILDTYPE=Release
| make -C out BUILDTYPE=Release V=1
|   touch ffec8618e06f50f8c62e1ff635021f102d0a41d4.intermediate
|   LD_LIBRARY_PATH=/home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/lib.host:/home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj/gen/src/inspector/protocol /home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
| make[1]: execvp: printf: Argument list too long
| deps/v8/src/v8_base.target.mk:633: recipe for target '/home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj.target/deps/v8/src/libv8_base.a' failed
| make[1]: *** [/home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj.target/deps/v8/src/libv8_base.a] Error 127
| rm ffec8618e06f50f8c62e1ff635021f102d0a41d4.intermediate
| Makefile:88: recipe for target 'node' failed
| make: *** [node] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_eglfs-linux-gnueabi/nodejs/8.12.0-r0/temp/log.do_compile.5426)

gokhannsahin
Associate II

I'm still getting this error while compiling nodejs? Should I change the nodejs versions?

JWali
Associate II

While cross compiling the meta-iot-cloud layer, it fails to compile nodejs 8.12 with the same error as above:

| make[1]: execvp: printf: Argument list too long
| make[1]: *** [/home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out/Release/obj.target/deps/v8/src/libv8_base.a] Error 127
| rm 87e866e2a67de632e2bf83828b5ea47ee79645b4.intermediate
| make[1]: Leaving directory `/home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/nodejs/8.12.0-r0/node-v8.12.0/out'
| make: *** [node] Error 2
| ERROR: oe_runmake failed
| WARNING: /home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/nodejs/8.12.0-r0/temp/run.do_compile.10771:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/nodejs/8.12.0-r0/temp/log.do_compile.10771)
ERROR: Task (/home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1903 tasks of which 1591 didn't need to be rerun and 2 failed.
NOTE: Writing buildhistory
 
Summary: 2 tasks failed:
  virtual:native:/home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb:do_compile
  /home/walicki/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/layers/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs_8.12.0.bb:do_compile

JWali
Associate II

There is a long discussion on this Yocto node / openssl builddir compile issue here:

https://github.com/imyller/meta-nodejs/issues/9

I still don't know the magic incantation.

JWali
Associate II

Thanks to a tip from a ST engineer, I have created a file called "nodejs_%.bbappend" with these contents 

   EXTRA_OEMAKE += "builddir_name=."

in this directory:

$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/layers/meta-openembedded/meta-oe/recipes-devtools/nodejs

and added a stanza to

$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v1.0.0/Starter-Package/stm32mp1-openstlinux-4.19-thud-mp1-19-02-20/layers/meta-openembedded/meta-oe/conf/layer.conf

to include nodejs

IMAGE_INSTALL_append += "nodejs"

I'm finally able to compile and build an image that includes node.js

gokhannsahin
Associate II

Thank you @JWali​ 

I get errors while compiling.

ERROR: Nothing RPROVIDES 'nodejsopenssh-sftp' (but /home/gokhan/STM32MP15-Ecosystem-v1.0.0/Distribution-Package/openstlinux-4.19-thud-mp1-19-02-20/layers/meta-st/meta-st-openstlinux/recipes-samples/images/st-example-image-qt.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'nodejsopenssh-sftp' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['nodejsopenssh-sftp']
ERROR: Required build target 'st-example-image-qt' has no buildable providers.
Missing or unbuildable dependency chain was: ['st-example-image-qt', 'nodejsopenssh-sftp']

I have created nodejs_8.12.0.bbappend file and added EXTRA_OEMAKE += "build-openstlinuxeglfs-stm32mp1=." line.

Hi,

The append instruction of IMAGE_INSTALL_append dos not add space on your IMAGE_INSTALL variable that means you have concatenated the existing content of IMAGE_INSTALL and 'nodejs' is why you see 'nodejsopenssh-sftp'.

To solve it you need to add space:

IMAGE_INSTALL_append = " nodejs "

christophe