How does yarn work when it encounters ^ (caret)?

Viewed 4441

How does yarn work when it encounter a ^ (caret) in package.json dependencies?

Let's say I have react: ^16.0.0 and when I yarn install, it will create a lock on that version (16.0.0).

Now sometime later when react 16.1.0 is released, and I yarn install again with the lock file, will yarn upgrade it to that version or follow what is in the lock file which is 16.0.0?

Thanks.

2 Answers

The selected answer is wrong.

caret means following

^3.1.4 will allow a version range from >=3.1.4 <4.0.0
Related