Skip to content

Instantly share code, notes, and snippets.

@dantullis
Created December 16, 2020 22:05
Show Gist options
  • Save dantullis/4a831207a378c33d5a54b4f50089adc9 to your computer and use it in GitHub Desktop.
Save dantullis/4a831207a378c33d5a54b4f50089adc9 to your computer and use it in GitHub Desktop.
Update-Package-On-NPM-Registry

Update Package On NPM Registry

Verify You Are Logged In

Try the following command to see if you are already logged in:

$ npm whoami

If not logged in, run the following command:

$ npm login

Follow the prompts to enter username, password, and email address

Major, Minor, or Patch

Determine whether your update type will be Major, Minor, or Patch. See Semantic Version Guidelines

Update Version Locally

Afterwards, the command to run will be in this format:

npm version <update_type>

For example:

$ npm version minor

This command will change the version number in package.json.

Publish Updated Package

While inside the package directory run:

$ npm publish

Verify It Is Updated

Navigate to a page similar to:

https://www.npmjs.com/package/<package>

Semantic Version Guidelines

Code Status Stage Example
First Release New Product 1.0.0
Bug fixes, minor changes Patch Release 1.0.1
New features that don't break existing features Minor Release 1.1.0
Changes that break backwards compatibility Major Release 2.0.0

License

MIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment