boschrexroth / ctrlx-automation-sdk

ctrlX AUTOMATION Software Development Kit
https://boschrexroth.github.io/ctrlx-automation-sdk/
Other
64 stars 24 forks source link

node and npm in sdk environment issue #48

Open TapioTaSo opened 3 months ago

TapioTaSo commented 3 months ago

Hi,

I have setup sdk environment and I have run install-sdk script. After that I can build snap and run sample codes line Nodejs Hello-world. Now I want to write simple server with expressjs, but it seems that there is no npm package manager installed to sdk environment so its hard to fetch new packet like expressjs. I tried to run install-node-npm script and it do something but if I try to run npm I get answer "boschrexroth@app-builder-amd64:~$ npm /snap/node/8723/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.30' not found (required by /snap/node/8723/bin/node) /snap/node/8723/bin/node: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.34' not found (required by /snap/node/8723/bin/node) /snap/node/8723/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by /snap/node/8723/bin/node) /snap/node/8723/bin/node: /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.33' not found (required by /snap/node/8723/bin/node)" IS there some technical problem or do I use this just wrong way?

albrecht-j commented 3 months ago

Hi @TapioTaSo what version of your app build environment? Is it based on ubuntu 20 or based on ubuntu 22? Also the node version is nice to know.

Thanks

TapioTaSo commented 3 months ago

ubuntu is 20 based (20.04.6 LTS)

Should there be some node after I have run install-sdk script. Should I also run install-node-npm script? Or should I install node from apt?

After install-sdk snap list doesn't not list node. And node --version doesn't not work either. So I can't say anything about node version.

ZmRZjFuDsDiR4qi5801F commented 3 months ago

Hi @TapioTaSo, @albrecht-j, Node versions >= 20 LTS are based on core22 (requested by us, because of Datalayer API), so running on a core20 image is missing some matching libs e.g. GLIBC_2.34. Installing the core22 snap won't help here, because of the snap confinement. So if you don't use the Datalayer API, you can flash your system with a core22 image or try installing a core20 compatible node:

sudo snap install node --channel=18/stable --classic

You can check and test your node with

node --version npm --version npm info npm