← Back to issue list

NPM Plugin: wrong node version is used to build the package

View original Github issue

Metadata

Project
craft-parts
Number
#770
Type
issue
State
open
Author
dimaqq
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action: keep open

Reason: Maintainer @cmatsuoka confirmed the root cause 9 days ago: 'there's no way to inject setup commands when override-build is used', provided a concrete workaround, and explicitly asked @lengau and @tigarmo for architectural input on a pre-build hook solution. The issue is triaged (Jira CRAFT-3124), valid, and awaiting a design decision that cannot be resolved without maintainer consensus.

Impact: 45 Quick Win: 11.25 Staleness: 40 Complexity: 75 Confidence: 82 Support Request: 20

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
qwen/qwen3.8-27b
Impact: 45
Quick Win: 11.25
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
close stale NPM plugin ignores npm-node-version, installing outdated system Node.js instead of the requested version. Open, inactive since July 2024, and tracked internally as CRAFT-3124. Needs triage and fix.

Update history

Date Change
updated

Related issues

No related issues found above the similarity threshold.