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.

empty package-lock.json is created even when there is no package.json #18131

@leggiero

Description

@leggiero

I'm opening this issue because:

  • npm is producing an incorrect install.

What's going wrong?

When executing npm install in a directory that there is no package.json the lock file is still created with only the lock file version:
{ "lockfileVersion": 1 }
Should be good to not create the lock if there is no package.json in the working directory.

How can the CLI team reproduce the problem?

  • create a new directory mkdir test
  • enter the newly created directory cd test
  • execute npm install

supporting information:

  • npm -v prints: 5.2.0
  • node -v prints: v6.10.2
  • npm config get registry prints: //registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions