npm version x --force?

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

$ npm version --force
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.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.