Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not add caret ^ sign to package installed with yarn?

I saw a solution for npm to change version prefix https://docs.npmjs.com/misc/config#save-prefix. What's the solution for yarn to not add caret?

I'd like to configure it not globally, but only for current project, if possible.

So, when I run something like yarn add --dev webpack, it saves its version as "webpack": "3.6.0", not "webpack": "^3.6.0".

like image 205
Sergei Basharov Avatar asked Oct 03 '17 10:10

Sergei Basharov


1 Answers

For anyone looking for a Yarn 2 solution, add .yarnrc.yml with the following content:

defaultSemverRangePrefix: ""

Reference: https://yarnpkg.com/configuration/yarnrc

like image 105
Ilya Kushlianski Avatar answered Oct 11 '22 18:10

Ilya Kushlianski