title: How to prevent NPM overwriting a dependency with a git url with a version
body: <p>This is very frustrating and I cannot find an answer.</p>
  <p>I have a dependency in my package.json file which is a git repo url.</p>
  <p>Each time I call npm update on that module, npm replaces the url with a version and updates no longer work since the url is removed.</p>
  <p>Before npm install</p>
  <pre><code>  &quot;license&quot;: &quot;Unlicense&quot;,
    &quot;dependencies&quot;: {
      &quot;myapp&quot;: &quot;git+https://github.com/myid/myrepo.git&quot;
    },
  </code></pre>
  <p>After npm install</p>
  <pre><code>  &quot;license&quot;: &quot;Unlicense&quot;,
    &quot;dependencies&quot;: {
      &quot;myapp&quot;: &quot;^0.0.51&quot;
    },
  </code></pre>
  <p>How do I prevent npm from over-writing this ?</p>
  <h3>edit</h3>
  <p>This is similar to this which also has no answer: <a href="https://stackoverflow.com/questions/68652137/how-to-prevent-package-json-beign-rewritten-by-npm-update">How to prevent `package.json` beign rewritten by `npm update`</a></p>