I had to change the version of my npm app from 0.1 to 0.0.1 in order for npm not to do this.
$ npm install
npm ERR! install Couldn\'t read dependencies
npm
Simple answer - use 0.1.0
0.1
will not work
Happy coding!
So yea, the short answer is "You need to use semantic versioning"
But the reasoning behind that is to provide a sensible, uniform package version to all users of npm. When getting a version number of an package, you have some level of confidence that the author understands semver and is employing it properly.
Yes, this is required for semantic versioning, which is the versioning scheme npm packages use. Here's the snippet from npm help json:
Version must be parseable by node-semver, which is bundled with npm as a dependency. (
npm install semver
to use it yourself.)Here's how npm's semver implementation deviates from what's on semver.org:
- Versions can start with "v"
- A numeric item separated from the main three-number version by a hyphen will be interpreted as a "build" number, and will increase the version. But, if the tag is not a number separated by a hyphen, then it's treated as a pre-release tag, and is less than the version without a tag. So,
0.1.2-7 > 0.1.2-7-beta > 0.1.2-6 > 0.1.2 > 0.1.2beta