What is the current behavior?
Calling yarn on PowerShell with stderr redirected to a file results in an error message:
TypeError: Expected `count` to be a positive finite number
at module.exports (C:\Program Files (x86)\Yarn\node_modules\repeating\index.js:10:9)
at ProgressBar.render (C:\Program Files (x86)\Yarn\lib\reporters\console\progress-bar.js:58:22)
at ConsoleReporter.progress (C:\Program Files (x86)\Yarn\lib\reporters\console\console-reporter.js:388:9)
at C:\Program Files (x86)\Yarn\lib\package-fetcher.js:123:36
at Generator.next (<anonymous>)
at step (C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:35:14
at F (C:\Program Files (x86)\Yarn\node_modules\core-js\library\modules\_export.js:35:28)
at C:\Program Files (x86)\Yarn\node_modules\babel-runtime\helpers\asyncToGenerator.js:14:12
at PackageFetcher.init (C:\Program Files (x86)\Yarn\lib\package-fetcher.js:158:7)
If the current behavior is a bug, please provide the steps to reproduce.
yarn install somepackage 2>c:\somefile.txtWhat is the expected behavior?
Yarn should also work if stderr is redirected to a file
Please mention your node.js, yarn and operating system version.
A workaround is using yarn config set no-progress true which is available since 0.19.1 (see #1962)
@BYK PR #4742 wouldn't address this.
I was able to reproduce with the v0.17.6 code, but you don't get the reported error in current yarn.
This is because the commit 864b563074 switched to use string.prototype.repeat, and that is amenable to being passed NaN.
There is some tidy-up to do, as yarn is looking at process.stdout to see if it is a TTY, but then writing the progress bar to process.stderr (so terminal control codes get written to a file).
I am also getting this error
`Arguments:
/usr/local/bin/node /usr/local/bin/yarn
PATH:
...
Yarn version:
0.18.1
Node version:
9.11.1
Platform:
linux x64
npm manifest:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0-beta.6",
"@vue/cli-plugin-eslint": "^3.0.0-beta.6",
"@vue/cli-service": "^3.0.0-beta.6"
}
}
yarn manifest:
No manifest
Lockfile:
No lockfile
Trace:
TypeError: Expected count to be a positive finite number
at module.exports (/usr/local/lib/node_modules/yarn/node_modules/repeating/index.js:10:9)
at ProgressBar.render (/usr/local/lib/node_modules/yarn/lib/reporters/console/progress-bar.js:58:22)
at ConsoleReporter.progress (/usr/local/lib/node_modules/yarn/lib/reporters/console/console-reporter.js:396:9)
at /usr/local/lib/node_modules/yarn/lib/package-fetcher.js:123:36
at Generator.next (
at step (/usr/local/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /usr/local/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at new Promise (
at new F (/usr/local/lib/node_modules/yarn/node_modules/core-js/library/modules/_export.js:35:28)
at /usr/local/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
`
can someone help me? This yarn config set no-progress true is not working for me
if you have this problem make sure you are running the latest versions of node, nodejs, yarn:
node --version
nodejs --version
npm --version
grunt --version
yarn --version
I had to uninstall yarn with this command: npm uninstall -g yarn and then install it again using this link. Now everything is working fine :dagger:
Closing this. If this is is still an issue on 1.21.1, please comment and I'll reopen.
Most helpful comment
A workaround is using
yarn config set no-progress truewhich is available since 0.19.1 (see #1962)