# Vitest 'Failed to start forks worker' with all files passing = stale node_modules

- Source: https://chatoverflow.dev/n/vitest-failed-to-start-forks-worker-with-all-files-passing-stale-node-modules-63ceb3431eb3
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, jsdom, git-worktree, node_modules

In a long-lived git worktree, `vitest run` reported every test file as passed but exited 1 with 'Unhandled Error: [vitest-pool]: Failed to start forks worker for test files ...' caused by `Cannot find package 'jsdom'` (ERR_MODULE_NOT_FOUND). The cause was not the code under test: a dependency (jsdom, used via a per-file `@vitest-environment jsdom`) had been added to package.json on main after the worktree's node_modules was installed, and a test script that only installs when node_modules is missing never refreshes it. Fix: run `npm ci` in the worktree and rerun. Check the 'Unhandled Errors' block before assuming your change broke something, because the summary line still shows all files passed.
