← Back to issue list

nodejs plugin assumes a version key in the package.json

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1838474
Type
issue
State
open
Author
~robcresswell-deactivatedaccount
Labels
Created
Updated
Closed

Current evaluation

Nodejs plugin crashed with KeyError when package.json lacked a version key, with no fallback to snapcraft.yaml version. Reported 2019, zero comments, no maintainer response. The nodejs plugin has since been removed and replaced by the npm plugin, so the referenced code no longer exists.

Suggested action: close stale

Reason: The issue references snapcraft/plugins/nodejs.py#L211, but that file no longer exists in the current tree — docs/how-to/change-bases/change-from-core18-to-core20.rst states 'The nodejs plugin is now npm', and the npm plugin now lives in craft-parts. The affected component is no longer supported and the original problem is no longer reproducible in current snapcraft. No maintainer ever responded and the reporter's account is deactivated.

Impact: 20 Quick Win: 12.0 Staleness: 95 Complexity: 40 Confidence: 75 Support Request: 10

Issue body

The nodejs plugin currently assumes a version key is present in the package.json[1]; crashing out with a KeyError if it isn't, and doesn't enable any other way of providing a package version, nor does it appear to inherit or otherwise use the 'version' key in the snapcraft.yaml. What's the best way to fix this? I've really lost my patience trying to wrestle with the tooling and broken links in the documentation, so I'd like to raise a PR to address this ASAP so I can move on. 1. https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/nodejs.py#L211

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 20
Quick Win: 12.0
Staleness: 95
Complexity: 40
Confidence: 75
Support Request: 10
close stale Nodejs plugin crashed with KeyError when package.json lacked a version key, with no fallback to snapcraft.yaml version. Reported 2019, zero comments, no maintainer response. The nodejs plugin has since been removed and replaced by the npm plugin, so the referenced code no longer exists.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 5
close stale Nodejs plugin crashes with KeyError when package.json lacks a version key. Untriaged, inactive for ~7 years, no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 85
Support Request: 5
close stale Nodejs plugin crashes with KeyError when package.json lacks a version key. Unlabeled, no maintainer response, inactive for over 7 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 10
close stale Nodejs plugin crashes with KeyError when package.json lacks a version key. Open for ~7 years with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 5
close stale Nodejs plugin crashes with KeyError if package.json lacks a version key. Issue is over six years old with no maintainer response or labels.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1886858 nodejs plugin doesn't set npm path for custom node version snapcraft (launchpad) open Bug: snapcraft's nodejs plugin downloads a custom nodejs-version but still runs build commands with the default node, leaving npm out of PATH. Reporter supplied a PATH workaround. 6 years old, no labels, zero comments, no maintainer response; nodejs plugin since deprecated/removed.
72%
#2424 nodejs plugin: fail gracefully when a package.json is missing snapcraft merged Merged into master. The nodejs plugin now fails gracefully when package.json is missing, resolving LP #1807971 and SNAPCRAFT-9X. The change adds 40 lines and removes 8 across two files, achieving 100% diff coverage.
70%