Why does npm init default to 1.0.0 version ?

Question 259 10 Sep 2016

Write answer

  • Sort By :
  • Popular
  • Recent

This answer has received 2 appreciations.

That is a good question.

NPM follows the semver conventions and as such it encourages you to ship code starting at v1.0.0. Unfortunately, some projects ignore that rule and can cause troubles when calculating version numbers used for dependency management or publishing to npmjs.org.

If I setup a new development environment one thing I do is changing the npm init defaults.

npm config edit --global

I set init-author-name, init-author-email and init-version. A new initialized project is never "stable". So my default version is 0.1.0.

Personally I think init should start at 0.1.0, being the first dev version. The author should choose when to cut 1.0.0 and set their API.

To me 1.0.0 is a stable version...

NPM specifies that it uses/expects SemVer so you're absolutely right.

Never miss an interesting discussion,
when you sign up for Hashnode. Learn more

loading ...