I have a npm module which is already released under 4.x.x
version and have breaking changes comparing to 3.x.x
stable version.
However I have some updates to 3.x.x
version and want to patch its' npm version. Is it possible? Can I manage 2 major versions on npm?
Will https://docs.npmjs.com/cli/publish npm publish --tag
do the trick?
However I have some updates to 3.x.x version and want to patch its' npm version. Is it possible? Can I manage 2 major versions on npm?
Yes, it's possible. Something that's common is to have the master
branch for new developement and branch off older versions if you want to patch them and name them e.g. 3.x
.
So if we assume your module has previously been released as 3.1.2
and you want to fix a bug, i.e. you want to publish 3.1.3
(patch release). Simply branch off from 3.1.2
(assuming you have a git tag v3.1.1
):
git checkout v3.1.2
git checkout -b 3.x
# make changes and commit
npm version patch # will bump package.json, commit that and tag
npm publish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With