Help us understand the problem. What is going on with this article?

Node.jsのpackage.jsonのバージョン指定の"~(チルダ)"と"^(キャレット)"の違い

More than 5 years have passed since last update.

参考:https://www.npmjs.org/doc/misc/semver.html

1.2.3につける場合を例に説明する

~: マイナーバージョンは最新で、それ以外は固定

1.2.3 <= ~1.2.3 < 1.3.x

^:メジャーバージョンは固定で、それ以外は最新

1.2.3 <= ^1.2.3 < 2.x.y

kondei
justincase
テクノロジーで保険を身近にする保険スタートアップです。
https://justincase.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away