Closed
Description
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.
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:
- Check out a project into a folder with a name that matches the name of the package.
- Do an
npm install
- Check the content of
package-lock.json
and confirm that oddname
property does not exist. - Rename the project folder to something that does not match the name of the package.
- Do an
npm install
- Note that `package-lock.json" changes.
- Open
package-lock.json
and confirm that oddname
property does exist.