<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">When using npm@7, if the folder name in which the project is being built <em>matches</em> the name of the project in <code class="notranslate">package.json</code>, a <code class="notranslate">name</code> property is actively removed (or never set) from package-lock.json.</p>
<p dir="auto">If the project folder does <em>not</em> match the name in <code class="notranslate">package.json</code> then the property is actively set.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2965467/109031460-c194f680-7692-11eb-9d0b-fcc8d35ed52c.jpg"><img src="https://user-images.githubusercontent.com/2965467/109031460-c194f680-7692-11eb-9d0b-fcc8d35ed52c.jpg" alt="d219a7b5-b720-4017-9ab9-8c527b1e52b5" style="max-width: 100%;"></a></p>
<p dir="auto">This is a change controlled file by definition.  At the very least, this can cause thrashing of <code class="notranslate">package-lock.json</code> if multiple developers are working on the same project and their working copies are in different folders.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">The folder in which a project is checked out on the local file system should have <em>zero</em> bearing on the content of <code class="notranslate">package-lock.json</code>.</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<ol dir="auto">
<li>Check out a project into a folder with a name that matches the name of the package.</li>
<li>Do an <code class="notranslate">npm install</code></li>
<li>Check the content of <code class="notranslate">package-lock.json</code> and confirm that odd <code class="notranslate">name</code> property <em>does not</em> exist.</li>
<li>Rename the project folder to something that does <em>not</em> match the name of the package.</li>
<li>Do an <code class="notranslate">npm install</code></li>
<li>Note that `package-lock.json" changes.</li>
<li>Open <code class="notranslate">package-lock.json</code> and confirm that odd <code class="notranslate">name</code> property <em>does</em> exist.</li>
</ol>
<h3 dir="auto">Environment:</h3>
<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">package-lock.json changes depending on name of local copy of git repo, e.g. if i have two copies of the same repo locally one which matches the name in package.json and one which doesn't i get two different package-lock files, one specifies the name of the package in the inner packages list and one doesn't.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">package-lock.json should be independent of top level directory name, when working in a team there shouldn't be unnecessary changes to package-lock file due to a team member having a different local name of their git repository.</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<ol dir="auto">
<li>clone a repository twice one in the default named directory and one into a name that differs from the repo name.</li>
<li>run <code class="notranslate">npm install</code></li>
<li>two different package-lock files will be generated.</li>
</ol>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>OS: Ubuntu 20.04</li>
<li>Node: 15.3.0</li>
<li>npm: 7.0.14</li>
</ul>