Update npm package

How to Update npm package

Thu Jul 15 2021

We can't publish a package twice to the npm, registry will check the package's version. Literally we can't update existing package, it will remain same.

How do we publish changes

Since packages need to be updated, we can use different version for new features, it also a good practice that the older version remain same, since there can be apps developed using those versions.

To publish a new version of the existing package, change the version key in the package.json (at the root of the project) and go on publish

npm adduser (optional)
npm publish 
or
npm publish --access=public

Comments