NPM Plugin: wrong node version is used to build the package
Metadata
Current evaluation
NPM node setup is skipped when override-build replaces built-in steps, so builds fall back to system Node 12.22.9; a manual-install workaround and future pre-build hook are proposed.
Suggested action: keep open
Reason: The maintainer explicitly identified that overridden build steps prevent injection of the NPM plugin's Node setup commands and provided manual installation as a workaround, while describing a pre-build hook as the long-term solution. No resolving commit or PR is cited, so the valid limitation remains unresolved.
Evaluated by: mr-cal-bot
Impact:
58
Quick Win:
19
Complexity:
55
Confidence:
92
Actionability:
72
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
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
58
Quick Win:
19
Complexity:
55
Confidence:
92
Actionability:
72
|
keep open | NPM node setup is skipped when override-build replaces built-in steps, so builds fall back to system Node 12.22.9; a manual-install workaround and future pre-build hook are proposed. | |
| qwen/qwen3.6-35b-a3b |
Impact:
70
Quick Win:
28
Complexity:
50
Confidence:
90
Actionability:
80
|
keep open | npm plugin ignores npm-node-version when override-build is used, falling back to system node v12 | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
11
Staleness:
40
Complexity:
75
Confidence:
82
Support Request:
20
|
keep open | npm plugin silently ignores npm-node-version when override-build is used, falling back to old system node. Maintainer confirmed root cause (no way to inject setup commands with override-build), provided workaround, and raised architectural question about pre-build hooks. Awaiting design input from maintainers. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
70
Complexity:
60
Confidence:
80
Support Request:
5
|
keep open | Bug where Rockcraft's npm plugin ignores the npm-node-version setting, using an outdated Node.js version instead. Maintainers acknowledged it, created a Jira ticket, provided a workaround, and requested architectural input for a long-term fix. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
85
Complexity:
40
Confidence:
80
Support Request:
15
|
close stale | NPM plugin ignores npm-node-version config, defaulting to Ubuntu's Node 12 instead of requested v20. Report lacks labels, maintainer response, and has been inactive for over a year. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
45
Confidence:
85
Support Request:
15
|
needs triage | NPM plugin ignores npm-node-version config, installing outdated Node.js and causing build failures. Report is detailed but remains unlabelled and unassessed by maintainers after over a year. |
Update history
| Date | Change |
|---|---|
| updated |
Related work
-
Related To:
traefik-rock#35
(confidence 95%)
Linked real-world configuration reproduces the Node 12.22.9 engine failure with override-build.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1955887 snapcraft npm doesn't respect npm-node-version | snapcraft (launchpad) | open | Legacy npm configuration was misleading: override-build bypasses the plugin-managed Node download; current craft-parts requires npm-include-node with npm-node-version. |