Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJs examples are not building #14

Open
ArcherThompson opened this issue Oct 26, 2022 · 1 comment
Open

NodeJs examples are not building #14

ArcherThompson opened this issue Oct 26, 2022 · 1 comment

Comments

@ArcherThompson
Copy link

ArcherThompson commented Oct 26, 2022

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants