I created a NPM module and I published it at version 0.0.1
I made some changes and pushed those to github, and I would like it so that when one uses npm install myModule
the new version is used.
How do I tell NPM that there is a version 0.0.2?
I created a NPM module and I published it at version 0.0.1
I made some changes and pushed those to github, and I would like it so that when one uses npm install myModule
the new version is used.
How do I tell NPM that there is a version 0.0.2?
Change the version in your package.json
or use npm version <new-version>
.
After changing the version number in your package.json
, you can run npm publish
to publish the new version to NPM.
npm install
will install the latest version in the NPM repository.
Increase the version number and then run npm publish yourModule
again - as described in the npm docs.
npm install yourModule
will then install the latest version from the NPM registry.
I found the last answer a little misleading, sorry.
For me, updating the version in the package.json
still resulted in the "You cannot publish over..." error.
The steps to resolve were (based on ops version number):
npm version 0.0.2
npm publish
If it is an patch release (small changes) use following:
npm version patch
It will increment the last part of version number.
If it is a minor release (new features) use following:
npm version minor
It will increment the middle part of version number.
If it is a major release (major features or major issue fixes) use following:
npm version major
It will increment the first part of version number.
From the npmjs documentation:
npm version <update_type>