Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
npm.installed mistakenly throws error for packages which are "installed via remote" #43138
Description of Issue/Question
However, the packages acutally are successfully installed, so a subsequent highstate will succeed.
The cause for this appears to be that the
Since #35075, there already is the special
Unfortunately, the line from above starts with a '[', although it's not part of the JSON.
NPM appears to always output a JSON object (not a list), so the checks could probably be limited to
Steps to Reproduce Issue
Create a target directory like "/tmp/npm-test" on the minion and try to install a NPM package like "sqlite3" or "bcrypt" using
It will fail with the error "Could not install package(s) 'sqlite3'", but the package will still be installed.
Yeah, secial-casing all kinds of output feels rather ugly, but I suspect it's necessary.
Obviously, an alternative would be getting NPM to only output JSON to stdout in JSON mode. I suppose that's not really a solution for Salt, as older versions of NPM would still have to be supported? But maybe it is still worth trying for the future.
added a commit
Nov 12, 2017
Ah, I see, this is triggering the normal check for the start of json output. Is the output of
Would the following work?