Detox: Could not parse CLI arguments supported by "jest-cli" package, see the error below

What happened?

After going throught the documentation and running detox test --configuration android it bombs out and gives the following stack trace

detox[28124] ERROR: [cli.js] Could not parse CLI arguments supported by "jest-cli" package, see the error below.
detox[28124] ERROR: [cli.js] Error: Cannot find module '\node_modules\jest-cli\build\cli\args.js'
ERROR: [cli.js]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
ERROR: [cli.js]     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
ERROR: [cli.js]     at Module.require (internal/modules/cjs/loader.js:974:19)
ERROR: [cli.js]     at require (internal/modules/cjs/helpers.js:101:18)
ERROR: [cli.js]     at resolveJestCliArgs \node_modules\detox\local-cli\utils\jestInternals.js:52:12)
ERROR: [cli.js]     at getJestBooleanArgs \node_modules\detox\local-cli\utils\splitArgv.js:54:12)
ERROR: [cli.js]     at Object.splitJestArgv [as jest] \node_modules\detox\local-cli\utils\splitArgv.js:91:53)
ERROR: [cli.js]     at prepareJestArgs \node_modules\detox\local-cli\test.js:170:44)
ERROR: [cli.js]     at Object.test [as handler] \node_modules\detox\local-cli\test.js:38:31)

What was the expected behaviour?

It should run the command as expected in the documentation

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

Went through the documentation as this is a fresh install of detox after configuring everything and installing the needed packages (jest, detox and setup the configs etc) I ran detox test --configuration android and it bombs out sky high giving this error

detox[28124] ERROR: [cli.js] Could not parse CLI arguments supported by "jest-cli" package, see the error below.
detox[28124] ERROR: [cli.js] Error: Cannot find module '\node_modules\jest-cli\build\cli\args.js'
ERROR: [cli.js]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
ERROR: [cli.js]     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
ERROR: [cli.js]     at Module.require (internal/modules/cjs/loader.js:974:19)
ERROR: [cli.js]     at require (internal/modules/cjs/helpers.js:101:18)
ERROR: [cli.js]     at resolveJestCliArgs \node_modules\detox\local-cli\utils\jestInternals.js:52:12)
ERROR: [cli.js]     at getJestBooleanArgs \node_modules\detox\local-cli\utils\splitArgv.js:54:12)
ERROR: [cli.js]     at Object.splitJestArgv [as jest] \node_modules\detox\local-cli\utils\splitArgv.js:91:53)
ERROR: [cli.js]     at prepareJestArgs \node_modules\detox\local-cli\test.js:170:44)
ERROR: [cli.js]     at Object.test [as handler] \node_modules\detox\local-cli\test.js:38:31)

In what environment did this happen?

Detox version: "detox": "^19.12.5", React Native version: "react-native": "0.69.4", Node version: v14.20.0 Device model: Pixel 4 Android version: 12 Test-runner (select one): jest as recommended by the documentation

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste logs here!

More data, please!

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Most upvoted comments

Downgrade to Jest 28.x meanwhile.

I’m facing this issue on 29.3.1 too

ETA is 1 hour approx.