npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm version x --force?

Hi! We are using a weird versioning scheme which is not semver.

$ npm version --force 20.30.00.1
npm WARN using --force I sure hope you know what you are doing.
npm ERR! npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
npm ERR! (run in package dir)
npm ERR! 'npm -v' or 'npm --version' to print npm version (6.4.1)
npm ERR! 'npm view <pkg> version' to view a package's published version
npm ERR! 'npm ls' to inspect current package/dependency versions

I’d like to bump the version in the package.json, package-lock.json and do a git tag at the same time. I’m curious as to how to do this?


The version command is expecting a semver. The documentation mentions this more explicitly than the error message, and also explains the --force flag is for skipping the check that the git directory is clean.

https://docs.npmjs.com/cli/version.html