ajhsu / blog

The external storage of my brain.
3 stars 0 forks source link

Why `npm install` uses carats(^) instead of tildes(~) by default? #37

Open ajhsu opened 7 years ago

ajhsu commented 7 years ago

Reading material

http://fredkschott.com/post/2014/02/npm-no-longer-defaults-to-tildes/

TL; DR

Main reason

(Still figuring out)

Differences between tildes(~) and carats(^)

Read more on npm documentation - semver

Spec of semver

Given a version number MAJOR.MINOR.PATCH, increment the:

Learning with npm semver calculartor

https://semver.npmjs.com/

You can try to give a version number like ^1.0.0 and the calculator will tells you the range of included version numbers.