Do you want to request a feature or report a bug?
Bug
What is the current behavior?
The output of yarn config
is empty if run from within a yarn script.
If the current behavior is a bug, please provide the steps to reproduce.
package.json
: "scripts": {
"debug": "yarn config list"
}
yarn run debug
.What is the expected behavior?
Expect yarn run debug
to produce the same output as npm run debug
or yarn config list
.
Please mention your node.js, yarn and operating system version.
node.js v6.11.0
yarn v0.27.5
OS Ubuntu 16.04
Seems this was introduced sometime between v0.24.5 and v0.27.5. We were using this behavior as part of a docker build script that would internally grab an NPM authorization token (from yarn config
) to provide it to the docker container being built. Would be nice to see the regression fixed, to bring this back into line with npm's behavior.
This causes authentication errors when install
is in a script, if you have private repositories. Example:
"scripts": {
"startup": "yarn install --pure-lockfile && bower install && ember s"
}
Confirmed issue still present in 1.0.1
.
Thanks for the report! This is because scripts are run with YARN_SILENT=1
and yarn config list
doesn't output anything in silent mode.
Will submit a PR to fix this.
😄 Thanks @BYK