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

后端 未结 19 1853
温柔的废话
温柔的废话 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 00:47

    ~ : Reasonably close to

       ~1.1.5: 1.1.0 <= accepted < 1.2.0
    

    ^: Compatible with

       ^1.1.5: 1.1.5 <= accepted < 2.0.0
    
       ^0.1.3: 0.1.3 <= accepted < 0.2.0
    
       ^0.0.4: 0.0.4 <= accepted < 0.1.0
    

提交回复
热议问题