yarn bin
can usually be used to return to path to a binary installed locally.
It seems like it doesn't work once it run on a Github action. Is there anything else in this environment that throw offs Yarn path detection?
The command I'm running is yarn node --experimental-vm-modules $(yarn bin jest)
(works locally, but fails on Github.) That's the command recommended by Jest to run tests on native esm
modules.
I have an example failed run here you can see
$ yarn node --experimental-vm-modules $(yarn bin jest)
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/home/runner/work/Inquirer.js/Inquirer.js//home/runner/work/Inquirer.js/Inquirer.js/node_modules/.bin/jest'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
error Command failed.
The weird thing is that the path seems to include the home directory 2 times /home/runner/work/Inquirer.js/Inquirer.js//home/runner/work/Inquirer.js/Inquirer.js/node_modules/.bin/jest
- it's likely related to why it fails, but I can't figure out how it ends up like this 🤔