nodejs plugin: build fails if there are missing peer dependencies.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
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_
# There is no yarn ls
cmd = [os.path.
try:
output = self.run_
except subprocess.
# 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.
```
However, `run_output()` itself captures the `CalledProcessE
```
def run_output(self, cmd, cwd=None, **kwargs):
if not cwd:
cwd = self.builddir
os.
try:
return common.
except CalledProcessError as process_error:
raise errors.
) from process_error
```