Yarn failing on CI on Windows
nicolo-ribaudo opened this issue · 6 comments
Something broke in Yarn between April 7 and April 12. Maybe a new release? The first failing commit is 9cd048b, that doesn't touch Yarn in any way. This what CI logs:
rm -rf node_modules
rm -rf packages/*/node_modules
rm -rf codemods/*/node_modules
rm -rf eslint/*/node_modules
yarn install
Error:
command: C:\NPM\PREFIX\YARN.CMD install
code: null
at Vy (D:\a\babel\babel\Makefile.js:4:124507)
at Hy (D:\a\babel\babel\Makefile.js:4:124624)
at $y.bootstrap-only (D:\a\babel\babel\Makefile.js:4:127328)
at c.target.<computed> [as bootstrap-only] (D:\a\babel\babel\Makefile.js:4:104620)
at D:\a\babel\babel\Makefile.js:4:104727
at Array.forEach (<anonymous>)
at Timeout._onTimeout (D:\a\babel\babel\Makefile.js:4:104681)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
yarn gulp build-dev
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)
$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
It seems running yarn install
is failing, but the stack trace is useless (it's only our makefile-internal stack).
@liuxingbaoyu is it failing for you locally?
Now it is successful locally. I suspect this is a regression caused by the node version. I will try it after updating node.
I confirmed that nodejs/node@9095c91 was the cause, I'm surprised this was released as a security fix.
It looks like we can just pass the 'shell' option: nodejs/node@9095c91#diff-58df6954f1fee545ecd3b5e7571db022b56d00217b41e75d849edb1e0719d04dR4
I tried this and it throws an error because the path contains spaces.
C:\Program Files\nodejs\yarn.CMD
Can we somehow escape the space?
Sure!
I'm not sure if we need to escape parameters (git), that seems more convenient with execa
.