<h3 dir="auto">Current Behavior:</h3>
<p dir="auto">When using <code class="notranslate">npm version from-git</code>, the command should not fail.</p>
<h3 dir="auto">Expected Behavior:</h3>
<p dir="auto">The command fails, because it tries to create a git tag (which already exists)</p>
<h3 dir="auto">Steps To Reproduce:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm i -g npm@7
mkdir foo &amp;&amp; cd foo
git init .
npm init -y
git add package.json
git commit -m 'initial commit'
git tag -m 1.0.1 v1.0.1
npm version from-git"><pre class="notranslate"><code class="notranslate">npm i -g npm@7
mkdir foo &amp;&amp; cd foo
git init .
npm init -y
git add package.json
git commit -m 'initial commit'
git tag -m 1.0.1 v1.0.1
npm version from-git
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ERR! code 128
npm ERR! command failed
npm ERR! command /usr/bin/git tag -m 1.0.1 v1.0.1
npm ERR! fatal: tag 'v5.0.0' already exists

npm ERR! A complete log of this run can be found in:"><pre class="notranslate"><code class="notranslate">npm ERR! code 128
npm ERR! command failed
npm ERR! command /usr/bin/git tag -m 1.0.1 v1.0.1
npm ERR! fatal: tag 'v5.0.0' already exists

npm ERR! A complete log of this run can be found in:
</code></pre></div>
<h3 dir="auto">Environment:</h3>
<ul dir="auto">
<li>Node: 15.0.1</li>
<li>npm: 7.6.3</li>
</ul>
<p dir="auto">I have found many and many issues related to <a href="https://docs.npmjs.com/cli/v7/using-npm/scripts#user" rel="nofollow">this</a> breaking change:</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1173350027" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/4589" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/4589/hovercard" href="https://github.com/npm/cli/issues/4589">#4589</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1064126786" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/4095" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/4095/hovercard" href="https://github.com/npm/cli/issues/4095">#4095</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1000023477" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/3773" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/3773/hovercard" href="https://github.com/npm/cli/issues/3773">#3773</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="863310533" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/3110" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/3110/hovercard" href="https://github.com/npm/cli/issues/3110">#3110</a></p>
<p dir="auto">Giving that there is no workaround to this except changing the directory permissions before running a command (that looks awful) could someone consider adding a flag to npm command or/and npm config that allows to override this?</p>
<p dir="auto">The change is explained <a href="https://github.com/npm/cli/issues/3110#issuecomment-826979929" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/3110/hovercard">here</a></p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wraithgar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wraithgar">@wraithgar</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ruyadorno/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ruyadorno">@ruyadorno</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lukekarrys/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lukekarrys">@lukekarrys</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fritzy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fritzy">@fritzy</a></p>
<p dir="auto">I can consider creating a PR if you agree with this</p>