Setting NPM Version Without 'v' Prefix

5 min read.
Tags: githubgit

By default, npm version creates git tags like v1.2.3. Some teams want plain tags like 1.2.3.

You can change that behavior with one config setting.

Command to remove v prefix

Run this in your project:

npm config set tag-version-prefix ""

After that, npm version patch will create tag format like 1.2.4 instead of v1.2.4.

Verify it works

  1. bump version:
npm version patch
  1. check latest git tag:
git tag --sort=-creatordate | head -n 3

You should see numeric tags without v.

Local vs global config

Project-only config:

npm config set tag-version-prefix "" --location=project

Global config on your machine:

npm config set tag-version-prefix "" --location=user

For team consistency, project-level config is usually safer.

CI and release note

If your release pipeline expects v* tags, changing this may break automation. Check your CI scripts first.

Things to confirm:

  • changelog generator tag pattern
  • deploy workflow trigger pattern
  • semantic-release or custom release scripts

Rollback command

If you want default behavior again:

npm config delete tag-version-prefix

Then tags return to v1.2.3 style.

Related Posts
Latest Posts