Yarn: Save exact by default: `yarn config set save-prefix ''`

Created on 5 Apr 2017  ·  3Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

$ yarn config set save-prefix ''
yarn config v0.21.3
success Set "save-prefix" to true.
✨  Done in 0.05s.
$ yarn add lodash
...
$ cat package.json
...
  "lodash": "true4.17.4",
...

What is the expected behavior?

I expect packages to have no prefix.

Please mention your node.js, yarn and operating system version.

$ yarn --version
0.21.3
$ node --version
v6.10.0

What do I want to achieve?
I want to save exact versions of the packages by default. I tried few other stuff, but it didn't work:
yarn config set save-exact, yarn config set exact

Most helpful comment

On Yarn v1.1, I ran into the same issue with the string "false" being prefixed. I tried using save-prefix '', but that caused an error. Using double quotes in my .yarnrc fixed it for me: save-prefix "".

All 3 comments

Kind of duplicate of https://github.com/yarnpkg/yarn/issues/1088

I used yarn config set save-prefix false and it's working.

@meznaric nope this doesn't work and causes the string "false" to be prefixed.

On Yarn v1.1, I ran into the same issue with the string "false" being prefixed. I tried using save-prefix '', but that caused an error. Using double quotes in my .yarnrc fixed it for me: save-prefix "".

Was this page helpful?
0 / 5 - 0 ratings