NPM Plugin: wrong node version is used to build the package
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
Looks like npm-node-version is not honoured. I've requested 20.15, but debug shows that 12.22.9 is actually used
### To Reproduce
- rockcraft 1.5.2 stable or 1.5.2.post1+g983a391 edge
- (not sure if important) an arm host or vm
- try build (errors out), see the log or poke using `--debug`
Observe that node version is v12.22.9 despite the requested latest or 20.15 or seemingly any.
### part yaml
```shell
traefik-frontend:
plugin: npm
source-type: git
source-depth: 1
source-tag: "v2.11.3"
source: https://github.com/traefik/traefik
npm-include-node: true
npm-node-version: "node"
build-packages:
- nodejs
- npm
override-build: |
npm install -g yarn && \
cd ./webui && \
# added --legacy-peer-deps to avoid dependency resolution errors with mocha (testing)
npm install --legacy-peer-deps && \
# Build the bundle as per:
# https://github.com/traefik/traefik/blob/84a081054688349fa4e2513599e3bf2395331492/Makefile#L66
npm run build:nc && \
# cleanup
rm -rf node_modules
```
### Relevant log output
```shell
...
2024-07-03 21:21:44.567 :: 2024-07-03 21:19:13.222 :: Get:15 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 libnode72 arm64 12.22.9~dfsg-1ubuntu3.6 [10.3 MB]
2024-07-03 21:21:44.567 :: 2024-07-03 21:19:14.202 :: Get:16 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 libnode-dev arm64 12.22.9~dfsg-1ubuntu3.6 [609 kB]
2024-07-03 21:21:44.567 :: 2024-07-03 21:19:14.245 :: Get:17 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 nodejs arm64 12.22.9~dfsg-1ubuntu3.6 [122 kB]
...
2024-07-03 21:21:44.574 :: 2024-07-03 21:21:37.268 :: npm WARN EBADENGINE Unsupported engine {
2024-07-03 21:21:44.574 :: 2024-07-03 21:21:37.268 :: npm WARN EBADENGINE package: 'traefik-ui@2.0.0',
2024-07-03 21:21:44.574 :: 2024-07-03 21:21:37.268 :: npm WARN EBADENGINE required: { node: '^20 || ^18 || ^16', npm: '>= 6.13.4', yarn: '>= 1.21.1' },
2024-07-03 21:21:44.574 :: 2024-07-03 21:21:37.268 :: npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
2024-07-03 21:21:44.574 :: 2024-07-03 21:21:37.268 :: npm WARN EBADENGINE }
...
2024-07-03 21:21:44.575 :: 2024-07-03 21:21:44.101 :: error traefik-ui@2.0.0: The engine "node" is incompatible with this module. Expected version "^20 || ^18 || ^16". Got "12.22.9"
Links:
https://github.com/canonical/traefik-rock/pull/35
https://matrix.to/#/!NPPCseDHKRvSBMUEXN:ubuntu.com/$oeD-GjAt-I3Yv8faXHn9OBVSmN5udLkB_Y4CKsBrslY?via=ubuntu.com&via=matrix.org
```
Evaluation history
No evaluation history available.