-
-
Notifications
You must be signed in to change notification settings - Fork 198
parse npm install results correctly #3213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can one of the admins verify this patch? |
|
run ci |
|
Hey @dnadoba , |
|
run ci |
|
@rosen-vladimirov |
|
run ci |
|
Hey @dnadoba , |
|
Hey @buuhuu , |
|
It has something to do with my dependencies and the package-lock.json. |
|
Hey @dnadoba , |
rosen-vladimirov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great. We'll do some manual verifications and we'll merge this PR.
|
I created a gist containing both files(sensible information removed): |
|
Hey @dnadoba , |

Solves Issue #3217
This pull request changes the implementation to search for the correct object by name. It does no longer depend on the position and should be more reliable especially as the
--jsonflag is experimental as described in the npm documentation: https://docs.npmjs.com/misc/config#jsonAs described in the comment of the current implementation of
parseNpmInstallResultswe just use the first object of theupdatedarray.nativescript-cli/lib/node-package-manager.ts
Lines 158 to 160 in e181f03
But when I execute the following command:
tns-iosis not the first element in theupdatedarray. The output looks something like this:{ "added": [], "removed": [], "updated": [ { "action": "update", "name": "colors", "version": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "path": "<path to project>/node_modules/colors", "previousVersion": "" }, { "action": "update", "name": "inherits", "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "path": "<path to project>/node_modules/inherits", "previousVersion": "" }, { "action": "update", "name": "tns-ios", "version": "3.3.0", "path": "<path to project>/node_modules/tns-ios", "previousVersion": "3.3.0" } ], "moved": [], "failed": [], "elapsed": 3113 }Instead of the first element,
tns-iosis the last element.I had an issue with the following command:
It always failed with the following error:
Now it works like a charm.