Describe the bug
Yarn fails when I try to install full-icu. I am aware it's builin in node v13 but my team would prefer to not install unstable node version.
To Reproduce
js repro
try {
await yarn(`add`, `full-icu`, '--dev');
expect(true).toBe(false);
} catch (error) {
expect(error.toString()).not.toContain('Failed with errors');
}
Screenshots

Environment if relevant (please complete the following information):
The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):
Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js add full-icu --dev
Usage Error: No project found in /tmp/tmp-27Zp87j6b027pB
$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] ...
at ChildProcess.exithandler (child_process.js:295:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().
This issue reproduces on master:
Error: expect(received).rejects.toThrowError()
Matcher error: received value must be a promise
Received has type: function
Received has value: [Function anonymous]
at Object.toThrowError (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-2.zip/node_modules/expect/build/index.js:229:11)
at module.exports (evalmachine.<anonymous>:4:12)
at /github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-2.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:56:19
at executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-2.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:17:22)
at Object.executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-2.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:24:18)
at ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-1.0.38-d4f5e2dbf3-2.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:25:59)
at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-2.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-2.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-2.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)
We couldn't reproduce your issue (all the assertions passed on master).
We couldn't reproduce your issue (all the assertions passed on master).
Here's logs
# This file contains the result of Yarn building a package (full-icu@npm:1.3.1)
# Script name: postinstall
npm install icu4c-data@64l (Node 12.10.0 and small-icu 64.2) -> icudt64l.dat
Looks like you are using yarn…
full-icu$ /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/node /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/yarn add icu4c-data@64l --no-lockfile --ignore-scripts
/private/var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/yarn:2
exec ".../bin/node" '.../.yarn/releases/yarn-berry.js' "$@"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected string
at Module._compile (internal/modules/cjs/loader.js:872:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11
.../node_modules/full-icu/install-spawn.js:62
throw(Error(cmdPath + ' ' + args.join(' ') + ' --> status ' + spawned.status));
^
Error: /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/node /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/yarn add icu4c-data@64l --no-lockfile --ignore-scripts --> status 1
at npmInstallNpm (.../node_modules/full-icu/install-spawn.js:62:9)
at Object.<anonymous> (.../node_modules/full-icu/postinstall.js:72:2)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11
I can't check right now, but it seems like their postinstall script is somehow calling node /path/to/yarn add ..., which doesn't work because it's a shellscript. Why not call yarn add ...?
/var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/node /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/tmp-30272oO0OXy5mgl56/yarn add icu4c-data@64l --no-lockfile --ignore-scripts
(Although even with that, running yarn add while an install is already in progress is completely invalid as it would likely lead to dependency tree corruptions)
Hi! 👋
This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).
Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolution faster). It helps us help you! 😃
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label.
Most helpful comment
I can't check right now, but it seems like their postinstall script is somehow calling
node /path/to/yarn add ..., which doesn't work because it's a shellscript. Why not callyarn add ...?(Although even with that, running
yarn addwhile an install is already in progress is completely invalid as it would likely lead to dependency tree corruptions)