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


I saw a solution for npm to change version 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".


You can do

$ yarn config set save-prefix false


$ echo save-prefix false >> .yarnrc


setting the value to false will install packages like this "some-package": "false3.0.4", which can be a bit misleading. If you don’t want a prefix at all then set it to an empty string via yarn config set save-prefix ""

Answered By – Noel

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published