Skip to main content
Visitor II
July 1, 2019
Question

Installing Node.js on the STM32MP1

  • July 1, 2019
  • 12 replies
  • 5288 views

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

    This topic has been closed for replies.

    12 replies

    Technical Moderator
    July 1, 2019

    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

    JWaliAuthor
    Visitor II
    July 30, 2019

    @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

    Visitor II
    July 30, 2019

    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)

    Visitor II
    August 1, 2019

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

    JWaliAuthor
    Visitor II
    August 27, 2019

    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

    JWaliAuthor
    Visitor II
    August 27, 2019

    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.

    JWaliAuthor
    Visitor II
    August 28, 2019

    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

    Visitor II
    August 28, 2019

    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.

    Visitor II
    August 28, 2019

    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

    Visitor II
    August 28, 2019

    I have generated image with bitbake st-example-image-qt command after added nodejs to local.conf .

    However, after added meta-iot-cloud to local.conf with CORE_IMAGE_EXTRA_INSTALL += "packagegroup-cloud-google", it gives the following erros;

    ERROR: nodejs-native-8.12.0-r0 do_compile: oe_runmake failed
    ERROR: nodejs-native-8.12.0-r0 do_compile: 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/x86_64-linux/nodejs-native/8.12.0-r0/temp/log.do_compile.28025)

    Technical Moderator
    January 14, 2020

    Hi,

    Sorry for late reply.

    Applying attached patch 0001-nodejs-bump-to-10.16.2 in Distribution package might fix the compilation issue by getting a more recent nodejs version.

      apply patch 0001-nodejs-bump-to-10.16.2.patch on meta-st-openstlinux

       put the following line on conf/local.conf

          PREFERRED_VERSION_nodejs = "10%"

          PREFERRED_VERSION_nodejs-native = "10%"

       and you must have:

          $> bitbake -s | grep node

             nodejs                                            :8.12.0-r0              :10.16.2-r0

             nodejs-native                                     :8.12.0-r0              :10.16.2-r0

    Olivier