boschrexroth / ctrlx-automation-sdk

ctrlX AUTOMATION Software Development Kit
https://boschrexroth.github.io/ctrlx-automation-sdk/
MIT License
60 stars 23 forks source link

NodeJs examples are not building #14

Open ArcherThompson opened 1 year ago

ArcherThompson commented 1 year ago

Last few lines when building any of the examples on two different virtual build environments (ctrlx works) is the following:

+ npm install -g --prefix /home/boschrexroth/ctrlx-automation-sdk/samples-node/datalayer.client.browse/parts/app/install datalayer-client-browse-1.0.0.tgz --only=prod --production --no-fund
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.
npm WARN config production Use `--omit=dev` instead.

added 100 packages, and audited 101 packages in 15s

found 0 vulnerabilities
++ npm -s run env echo '$npm_package_name'
+ package_name='$npm_package_name'
+ prebuilds_location='/home/boschrexroth/ctrlx-automation-sdk/samples-node/datalayer.client.browse/parts/app/install/lib/node_modules/$npm_package_name/node_modules/ctrlx-datalayer/prebuilds'
+ find '/home/boschrexroth/ctrlx-automation-sdk/samples-node/datalayer.client.browse/parts/app/install/lib/node_modules/$npm_package_name/node_modules/ctrlx-datalayer/prebuilds' -type f -not -ipath '*/linux-x64*' -delete
find: ‘/home/boschrexroth/ctrlx-automation-sdk/samples-node/datalayer.client.browse/parts/app/install/lib/node_modules/$npm_package_name/node_modules/ctrlx-datalayer/prebuilds’: No such file or directory
Failed to run 'override-build': Exit code was 1.

The ++ npm -s run env echo '$npm_package_name' seems to be the line that is returning '$npm_package_name' instead of npm which is the directory name

albrecht-j commented 1 year ago

Hi @ArcherThompson thanks for reporting this issue. We can reproduce it. You can fix this when you replace: package_name=$(npm -s run env echo '$npm_package_name') with package_name=$(npm pkg get name | tr -d '"') in the snapcraft.yaml.

Thank you Best Regards Johannes