<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">This issue exists in the latest npm version</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I am using the latest npm</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">package-lock.json does not contain an os-independent string for local dependencies, therefore package-lock.json is always changing when it was committed from windows and then building on linux.</p>
<p dir="auto">I think the issue might be that the lock file contains an OS-normalized string, while it should actually contain some string that is independent of the OS and only gets translated when the package-lock.json is parsed.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Expected behaviour would be that the same package-lock.json is generated no matter the OS.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<ol dir="auto">
<li>In Windows 10, node --version v16.13.2, npm --version = 8.5.4</li>
<li>Have a package json dependency like this:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: {
        &quot;some-local-dependency&quot;: &quot;file:../myproject/module&quot;
    }"><pre class="notranslate"><code class="notranslate">"dependencies": {
        "some-local-dependency": "file:../myproject/module"
    }
</code></pre></div>
<p dir="auto">On windows, this produces a package-lock.json on windows that has this relevant section generated:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: {
        &quot;some-local-dependency&quot;: {
            &quot;version&quot;: &quot;file:\\myproject\\module&quot;
        }
    }"><pre class="notranslate"><code class="notranslate">"dependencies": {
        "some-local-dependency": {
            "version": "file:\\myproject\\module"
        }
    }
</code></pre></div>
<p dir="auto">On linux, the same package json results in the following package-lock.json (and therefore makes the committed package-lock.json dirty in git):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: {
        &quot;some-local-dependency&quot;: {
            &quot;version&quot;: &quot;file:../myproject/module&quot;
        }
}"><pre class="notranslate"><code class="notranslate">"dependencies": {
        "some-local-dependency": {
            "version": "file:../myproject/module"
        }
}
</code></pre></div>
<p dir="auto">Both package-lock.json files shoud have the same path separator.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>npm: 8.5.4</li>
<li>Node.js: 16.13.2</li>
<li>OS Name: Windows 10</li>
<li>System Model Name: Dell</li>
<li>npm config:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="; &quot;builtin&quot; config from C:\Users\soura\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = &quot;C:\\Users\\soura\\AppData\\Roaming\\npm&quot;

; &quot;user&quot; config from C:\Users\soura\.npmrc

msvs_version = &quot;2019&quot;

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = 
; HOME = C:\Users\soura
; Run `npm config ls -l` to show all defaults.
"><pre class="notranslate"><code class="notranslate">; "builtin" config from C:\Users\soura\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\soura\\AppData\\Roaming\\npm"

; "user" config from C:\Users\soura\.npmrc

msvs_version = "2019"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = 
; HOME = C:\Users\soura
; Run `npm config ls -l` to show all defaults.

</code></pre></div>
<h3 dir="auto">Is there an existing issue for this?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li>
</ul>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">When installing a local dependency in Windows, the posix paths under "package-lock.dependencies" are converted to Windows style paths, with double backslashes. The paths in "package.json" and under "package-lock.packages" are kept unix style.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">package-lock is kept as is when installing dependencies.</p>
<h3 dir="auto">Steps To Reproduce</h3>
<p dir="auto">Clone and follow the instructions on <a href="/guilhermetod/npm-7-package-lock-issue">sample repository</a>.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>OS: Windows 10 20h2</li>
<li>Node: 16.2.0</li>
<li>npm: 7.13.0</li>
</ul>