Skip to content
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

view: Better errors when package.json is not JSON #2051

Closed

Conversation

isaacs
Copy link
Contributor

@isaacs isaacs commented Oct 26, 2020

Based on #2050, land that first.

Previously, npm view <noargs> was just saying "Invalid package.json"
if the package.json file was not JSON, or if it was missing.

This errors out with the appropriate error in these cases.

Also, no need to read the big clunky 'read-package-json' for this, we're
literally just checking for a single field. We can be a bit more
efficient here.

We show a list of bundled dependencies, there's no need to ALSO show
the individual files in each one.
Previously, `npm view <noargs>` was just saying "Invalid package.json"
if the package.json file was not JSON, or if it was missing.

This errors out with the appropriate error in these cases.

Also, no need to read the big clunky 'read-package-json' for this, we're
literally just checking for a single field.  We can be a bit more
efficient here.
@isaacs isaacs requested a review from a team as a code owner October 26, 2020 23:52
@darcyclarke darcyclarke added release: next These items should be addressed in the next release Release 7.x work is associated with a specific npm 7 release labels Oct 27, 2020
@nlf nlf closed this in 3ee8f3b Oct 27, 2020
@nlf nlf deleted the isaacs/better-view-error-on-invalid-package-json branch March 28, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: next These items should be addressed in the next release Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants