[NodeJS] – How to release a new npm lib/project version?

  • Create a tag for your release

$git tag -a <TagName> -m “<message>”

(E.g $git tag -a v1.2.0 -m “version v1.2.0”)

  • Push the tag to the repository

$git push <origin/remote> <TagName>

(E.g $git push upstream v1.2.0)

Notes: Now a new tag/release should appear in the “Release” feature of the GitHub page in this repository. Also, you are able to add/edit the release notes via the GitHub interface.

Screen Shot 2018-05-08 at 12.06.22 Screen Shot 2018-05-08 at 12.06.15Screen Shot 2018-05-08 at 12.13.50.png


If you are working on a fork project and would like to push the tag to the remote/upstream repository ensure/fix your locally git setup addressed as the following example.

$git remote remove upstream ## To remove the upstream setup

$git remote add upstream git@github.com:<repo>/myapp.git ## To add the upstream setup

  • Publish the new tag of your project

Run the command “$npm publish” in the root directory of your application. Ensure that you are in the master branch where the tag/release was created.

For further information check the docs.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s