jest command not found or not installed
April 30, 2026 ยท View on GitHub
Playbook ID: jest-command-not-found
Category: test
Severity: high
Tags: jest, node, test, command, missing
What this failure means
The jest command could not be found. Jest is either not installed as a dependency, not in the PATH, or the wrong shell was used to run it.
Common log signals
jest: command not found
path.*\.bin/jest
Diagnosis
Jest is typically installed locally as a dev dependency and accessed through npm run test or npx jest. Common causes:
- Jest is not listed in
package.jsonas adevDependency. npm installornpm ciwas not run before the test step, or it failed silently.- The script is running in a different shell that does not have the PATH updated.
- Jest is installed locally but the script tries to use the global
jestcommand. - The test step runs before the install step in CI.
The error typically appears as jest: command not found or jest is not installed.
Fix steps
-
Verify Jest is in
package.json:grep jest package.json -
If missing, add it as a dev dependency:
npm install --save-dev jest -
Ensure
npm installcompletes before running tests:npm install npm test -
Use
npm run testornpx jestinstead of callingjestdirectly:npm run test # Uses local jest from node_modules npx jest # Also uses local jest jest # May not work if jest is not in PATH -
Check that the CI job runs the test step after the install step:
steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: '18' - run: npm install # Must run BEFORE test - run: npm test # Now jest is available
Validation
npm installcompletes without errors.npm run testornpx jestexecutes tests successfully.npm ls jestshows jest is installed innode_modules.
Likely files to inspect
package.jsonjest.config.js.github/workflows/*.yml
Run Faultline
faultline analyze build.log
faultline explain jest-command-not-found
faultline workflow build.log --json --mode agent
Search phrases this page answers
- jest command not found or not installed
- Test: jest command not found or not installed
- jest: command not found
- faultline explain jest-command-not-found
- Node.js jest command not found or not installed
Generated from playbooks/bundled/log/test/jest-command-not-found.yaml. Do not edit directly โ run make docs-generate.