What's the difference between tilde(~) and caret(^) in package.json?

后端 未结 19 2111
温柔的废话
温柔的废话 2020-11-22 00:31

After I upgraded to latest stable node and npm, I tried npm install moment --save. It saves the entry in the package.json

19条回答
  •  不要未来只要你来
    2020-11-22 01:04

    ^ is 1.[any].[any] (latest minor version)
    ~ is 1.2.[any] (latest patch)

    A great read is this blog post on how semver applies to npm
    and what they're doing to make it match the semver standard
    http://blog.npmjs.org/post/98131109725/npm-2-0-0

提交回复
热议问题