From the npm version documentation at https://docs.npmjs.com/cli/version:
If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm –no-git-tag-version version. It will fail if the working directory is not clean, unless the -f or –force flag is set.
I’m not 100% certain whether you just need –no-git-tag-version, or if you’ll also need the –force flag.