I’m trying to build from within a lxd container, using the npm plugin.
(I get the same error on multipass)
Here is my snap/snapcraft.yaml
name: polkadot-rpc-check
base: core20
version: '0.1'
summary: Nagios plugin to check polkadot rpc endpoint.
description: |
This is a nagios plugin to check a pokadot rpc endpoint.
grade: devel
confinement: devmode
apps:
check-substraterpc:
command: bin/check-substraterpc
plugs:
- network
parts:
check-node:
source: .
plugin: npm
npm-node-version: "17.7.2"
$ snapcraft --use-lxd --debug
npm notice 641B snap/snapcraft.yaml
npm notice === Tarball Details ===
npm notice name: node-check
npm notice version: 1.0.0
npm notice filename: node-check-1.0.0.tgz
npm notice package size: 9.2 kB
npm notice unpacked size: 28.8 kB
npm notice shasum: 1bf28deebabf94c25d9a5801cf300c7f12e4e7c6
npm notice integrity: sha512-fo/0TNozzSFaa[...]jzs/Q9Buocl+w==
npm notice total files: 48
npm notice
+ npm install -g --prefix /root/parts/check-node/install node-check-1.0.0.tgz
npm ERR! code 127
npm ERR! path /root/parts/check-node/install/lib/node_modules/node-check/node_modules/utf-8-validate
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! sh: 1: node-gyp-build: Permission denied
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-03-19T15_32_36_630Z-debug-0.log
Failed to build 'check-node'.
Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.
I check some logs…
517 verbose argv "/root/parts/check-node/install/bin/node" "/root/parts/check-node/install/bin/npm" "install" "-g" "--prefix" "/root/parts/check-node/install" "node-check-1.0.0.tgz"
518 verbose node v17.7.2
519 verbose npm v8.5.2
520 error code 127
521 error path /root/parts/check-node/install/lib/node_modules/node-check/node_modules/utf-8-validate
522 error command failed
523 error command sh -c node-gyp-build
524 error sh: 1: node-gyp-build: Permission denied
525 verbose exit 127
526 timing npm Completed in 3266ms
527 verbose unfinished npm timer reify 1647703956901
528 verbose unfinished npm timer reify:build 1647703959499
529 verbose unfinished npm timer build 1647703959499
530 verbose unfinished npm timer build:deps 1647703959499
531 verbose unfinished npm timer build:run:install 1647703959505
532 verbose unfinished npm timer build:run:install:node_modules/node-check/node_modules/bufferutil 1647703959505
533 verbose unfinished npm timer build:run:install:node_modules/node-check/node_modules/utf-8-validate 1647703959521
534 verbose code 127
535 error A complete log of this run can be found in:
535 error /root/.npm/_logs/2022-03-19T15_32_36_630Z-debug-0.log
snapcraft-polkadot-rpc-check # exit
exit
… and I have no clue on how to continue.