yarn config unable to set boolean value

Created on 19 Oct 2016  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
bug

What is the current behavior?
Any config value set using the cli is treated as a string. Setting this config for strict-ssl (#841) is not honored and an unable to verify the first certificate error is raised. Setting the same value strict-ssl false in an .yarnrc results in a correct conversion.

If the current behavior is a bug, please provide the steps to reproduce.
yarn config set strict-ssl false
success Set "strict-ssl" to "false".

yarn config list
{ 'strict-ssl': 'false',
... }

What is the expected behavior?
yarn config set strict-ssl false
success Set "strict-ssl" to false.

yarn config list
{ 'strict-ssl': false,
... }

Please mention your node.js, yarn and operating system version.
node v6.7.0
yarn v0.16.0
Windows 10

Most helpful comment

I'm seeing the same behavior as @wesm87 and @thebetterjort in v0.18.1.

yarn config set strict-ssl false

results in the following in .yarnrc

strict-ssl "false"

All 6 comments

As a makeshift

$ yarn config set strict-ssl ""

Created #1590 to fix this, pending approval.

It seems like this has been reintroduced in recent versions (I've had this issue with both 0.17.9 and 0.18.0). I took a quick look at the source code and it looks like the NpmRegistry class is using Registry.normalizeConfig() but the YarnRegistry class isn't:

https://github.com/yarnpkg/yarn/blob/master/src/registries/npm-registry.js#L124
https://github.com/yarnpkg/yarn/blob/master/src/registries/yarn-registry.js#L81

Could this be causing the issue?

yarn config set strict-ssl ""
Is still required as of writing. You cannot do yarn config set strict-ssl false.

I'm seeing the same behavior as @wesm87 and @thebetterjort in v0.18.1.

yarn config set strict-ssl false

results in the following in .yarnrc

strict-ssl "false"

Looks like there's an open PR for this now: https://github.com/yarnpkg/yarn/pull/2440

Was this page helpful?
0 / 5 - 0 ratings