Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Context-less error thrown trying to parse an invalid package-lock.json #19628

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

If package-lock.json is empty, npm crashes with: Unexpected end of JSON input

image

How can the CLI team reproduce the problem?

  1. Install in a project normally
  2. Delete all content of package.json
  3. npm i

https://gist.github.com/JoshuaKGoldberg/74c591fa1d55462a2d290dd5dcae3051

supporting information:

  • npm -v prints: 5.5.1
  • node -v prints: 8.8.1
  • npm config get registry prints:
  • Windows, OS X/macOS, or Linux?: Windows 10 with cmder

Extra relevant because of #18131

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions