Skip to content

package-lock changes depending upon name of project folder #2770

Closed
@robross0606

Description

@robross0606

Current Behavior:

When using npm@7, if the folder name in which the project is being built matches the name of the project in package.json, a name property is actively removed (or never set) from package-lock.json.

If the project folder does not match the name in package.json then the property is actively set.

d219a7b5-b720-4017-9ab9-8c527b1e52b5

This is a change controlled file by definition. At the very least, this can cause thrashing of package-lock.json if multiple developers are working on the same project and their working copies are in different folders.

Expected Behavior:

The folder in which a project is checked out on the local file system should have zero bearing on the content of package-lock.json.

Steps To Reproduce:

  1. Check out a project into a folder with a name that matches the name of the package.
  2. Do an npm install
  3. Check the content of package-lock.json and confirm that odd name property does not exist.
  4. Rename the project folder to something that does not match the name of the package.
  5. Do an npm install
  6. Note that `package-lock.json" changes.
  7. Open package-lock.json and confirm that odd name property does exist.

Environment:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingDuplicateduplicate of another, existing issueRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions