[Bug]: jest-circus/build/runner.js in the testRunner option was not found on MacOS/jest30
Version
30.0.3
Steps to reproduce
- Use a system running MacOS 15.5 on ARM.
- Clone this repostitory: git clone 'https://github.com/eavdmeer/jest-30-bug/'.
- Run 'npm install'.
- Run 'npm test'.
Expected behavior
There should be output showing a successful test:
$ npm test
> [email protected] test
> jest --env node --passWithNoTests
PASS ./index.test.js
add tester
✓ add two numbers (2 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.147 s, estimated 1 s
Ran all test suites.
Actual behavior
Initial run of npm fails with error output:
$ npm test
> [email protected] test
> jest --env node --passWithNoTests
[[email protected]] Trying to install package "@unrs/resolver-binding-darwin-arm64" using npm
● Validation Error:
Module /Users/someone/Developer/jest-30-bug/node_modules/jest-circus/build/runner.js in the testRunner option was not found.
<rootDir> is: /Users/someone/Developer/jest-30-bug
Configuration Documentation:
https://jestjs.io/docs/configuration
Additional context
- Running
npm testa second time (and any subsequent times) after install produces the correct result. However, running it from any kind of subshell (like Apache ant) will have it fail every single time. - Adding a devDependency to
@unrs/resolver-binding-darwin-arm64beforenpm installwill makenpm testrun correctly immediately.
Environment
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M2 Pro
Binaries:
Node: 20.19.1 - ~/.nvm/versions/node/v20.19.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.19.1/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.19.1/bin/npm
npmPackages:
jest: ^30.0.3 => 30.0.3
Using the exact same code, on the same machine, but jest version 29 works:
rm -rf node_modules
npm install jest@29
nmp install
npm test
This outputs:
> [email protected] test
> jest --env node --passWithNoTests
PASS ./index.test.js
add tester
✓ add two numbers (1 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.184 s, estimated 1 s
Ran all test suites.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
I couldn't seem to reproduce the issue in even Jest v30.0.3, which is the presumably affected version.
I downloaded Apache Ant and run the npm test via its build config and it yielded success result.
From the repository I set up:
"devDependencies": {
"jest": "^30.0.4"
}
Maybe talk to curbengh. He seems to have been able to reproduce. Are you using MacOS on Arm? I've seen this as recently as yesterday on a MacBook Pro M2 Sequoia 15.6.1
@eavdmeer I have an Mac Silicon v2 on Sequoia 15.6.1 and even though I've retried with Jest 30.4 + 30.5, the test still succeeds.
Do you by any chance have jest installed globally? This issue only happens the first time you run jest after a fresh install. If you have it installed globally, you'll never see the issue. Please check with npm ls -g
No jest installed globally on my side. In fact, I changed the npm script to call the exact jest binary in project-wide node_modules
I get exactly the same issue in a linux debian PC
Without adding any other jest config, with version 29 everything is fine, but with v30
The issue seems to not always show up. I have a MacBook Air M3 that doesn't have the issue. However, I have confirmed that this still happens on my M2 Pro.
● Validation Error:
Module E:\some-folder\some-repo\node_modules\jest-circus\build\runner.js in the testRunner option was not found.
<rootDir> is: E:\some-folder\some-repo
Configuration Documentation:
https://jestjs.io/docs/configuration
Facing this in windows 11 system with jest 30.1.3
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Also still experiencing this issue, Windows 11, jest 30.1.3.
@JounQin have you seen this issue before?
@JounQin have you seen this issue before?
Sorry I didn't notice this issue, I'll take a look at the reproduction while the native binding should be installed automatically via napi-postinstall.
@timosandberg What npm version are you using?
@timosandberg What npm version are you using?
I was using 10.9.2, now upgraded to latest (11.6.2) but the issue remains.
@timosandberg Can you check your node_modules structure? Is node_modules/@unrs/resolver-binding-* package installed correctly there?
@timosandberg Can you check your node_modules structure? Is
node_modules/@unrs/resolver-binding-*package installed correctly there?
Yes, there's resolver-binding-win32-x64-msvc 1.11.1 installed.
Got the following error on MacOS 15.6.1 with jest 30, npm v8.11.0, node v17.9.1; downgrading to jest 29 clears the error:
● Validation Error:
Module /Users/.../node_modules/jest-jasmine2/build/index.js in the testRunner option was not found.
<rootDir> is: /Users/...