← Back to issue list

nodejs plugin: build fails if there are missing peer dependencies.

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1819804
Type
issue
State
closed
Author
~thebitlink
Labels
—
Created
Updated
Closed

Current evaluation

Closed as stale; the nodejs plugin has evolved considerably since the report, rendering the original peer dependency handling context obsolete.

Resolution: closed stale

Reason: Closed as stale by maintainer @mr-cal, noting that the nodejs plugin has evolved considerably since the bug report, making the original context obsolete.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This happens when trying to run `npm ls --json` at the build stage. If there are any missing peer dependencies, the command exits with a non-zero exit code. However, most of the time those errors can be safely ignored. An attempt to mitigate this is already in place: ``` def _get_installed_node_packages(self, cwd): # There is no yarn ls cmd = [os.path.join(self._npm_dir, "bin", "npm"), "ls", "--json"] try: output = self.run_output(cmd, cwd) except subprocess.CalledProcessError as error: # XXX When dependencies have missing dependencies, an error like # this is printed to stderr: # npm ERR! peer dep missing: glob@*, required by glob-promise@3.1.0 # retcode is not 0, which raises an exception. output = error.output.decode(sys.getfilesystemencoding()).strip() ``` However, `run_output()` itself captures the `CalledProcessError`, rasing a different type of exception (SnapcraftPluginCommandError): ``` def run_output(self, cmd, cwd=None, **kwargs): if not cwd: cwd = self.builddir os.makedirs(cwd, exist_ok=True) try: return common.run_output(cmd, cwd=cwd, **kwargs) except CalledProcessError as process_error: raise errors.SnapcraftPluginCommandError( command=cmd, part_name=self.name, exit_code=process_error.returncode ) from process_error ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b — closed stale Closed as stale; the nodejs plugin has evolved considerably since the report, rendering the original peer dependency handling context obsolete.
stealth/space-bunny-alpha
Impact: 40
Quick Win: 22
Complexity: 25
Confidence: 86
Actionability: 75
close stale Untriaged legacy Node.js plugin failure when npm ls reports missing peer dependencies; no activity since 2018, and the affected legacy component appears to have been removed
stealth/space-bunny-alpha
Impact: 15
Quick Win: 2
Complexity: 35
Confidence: 78
Actionability: 25
close stale Legacy nodejs plugin aborts builds on missing peer deps: its CalledProcessError mitigation in _get_installed_node_packages is dead code because run_output re-raises as SnapcraftPluginCommandError. The plugin no longer exists in snapcraft (moved to craft-parts).
stealth/space-bunny-alpha
Impact: 30
Quick Win: 15
Complexity: 35
Confidence: 94
Actionability: 75
close stale Legacy nodejs plugin is no longer present; current Snapcraft uses the npm plugin, whose implementation no longer runs npm ls --json, making the reported failure path obsolete.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 32
Staleness: 95
Complexity: 30
Confidence: 65
Support Request: 0
needs triage Snapcraft nodejs plugin build fails when npm ls --json exits non-zero on missing peer deps; the CalledProcessError fallback is dead code since run_output wraps it in SnapcraftPluginCommandError. Open 7.5 years, unlabelled, no maintainer activity.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 5
close stale Nodejs plugin build fails when npm ls --json encounters missing peer dependencies. The run_output wrapper catches and re-raises the exception, bypassing the intended fallback logic. The issue is over 7 years old with no maintainer engagement.
qwen/qwen3.6-35b-a3b
Staleness: 100
Complexity: 40
Confidence: 90
Support Request: 10
close stale Nodejs plugin build fails due to missing peer dependencies causing npm ls to exit non-zero. Issue is 7+ years old with no activity or maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 5
needs triage Nodejs plugin build fails during npm ls due to missing peer dependencies triggering an unhandled exception. Issue remains untriaged and inactive for over seven years.

Update history

Date Change
created

Related issues

Issue Project State Summary Similarity
#1802496 Nodejs plugin doesn't rebuild properly snapcraft (launchpad) closed Closed as stale by maintainer ~mr-cal on 2026-07-24; no implementation or resolving PR was recorded.
70%