Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module '@jest/test-sequencer' #8268

Closed
elliottsj opened this issue Apr 3, 2019 · 6 comments
Closed

Error: Cannot find module '@jest/test-sequencer' #8268

elliottsj opened this issue Apr 3, 2019 · 6 comments

Comments

@elliottsj
Copy link

elliottsj commented Apr 3, 2019

馃悰 Bug Report

Getting this fatal error when running Jest with pnpm:

Error: Cannot find module '@jest/test-sequencer'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /Users/spencerelliott/Dev/path/to/node_modules/.registry.npmjs.org/@jest/core/24.7.0/node_modules/@jest/core/build/runJest.js:290:9
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/spencerelliott/Dev/path/to/node_modules/.registry.npmjs.org/@jest/core/24.7.0/node_modules/@jest/core/build/runJest.js:148:24)
    at _next (/Users/spencerelliott/Dev/path/to/node_modules/.registry.npmjs.org/@jest/core/24.7.0/node_modules/@jest/core/build/runJest.js:168:9)
    at /Users/spencerelliott/Dev/path/to/node_modules/.registry.npmjs.org/@jest/core/24.7.0/node_modules/@jest/core/build/runJest.js:173:7
    at new Promise (<anonymous>)

To Reproduce

Steps to reproduce the behavior:

npm install --global pnpm@2.25.6
pnpm install jest
./node_modules/.bin/jest

Expected behavior

No fatal error.

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 10.15.0 - /var/folders/ms/t3l222rn1v3dkvvnytj4vfkw0000gn/T/fnm-shell-1068309/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.8.0 - /var/folders/ms/t3l222rn1v3dkvvnytj4vfkw0000gn/T/fnm-shell-1068309/bin/npm
  npmPackages:
    jest: ^24.7.0 => 24.7.0
@SimenB
Copy link
Member

SimenB commented Apr 3, 2019

I guess this will be fixed by #8267

@willsmythe
Copy link
Contributor

I am running into a similar problem with Jest 24.7.0 (I'm not using pnpm however). The root cause seems to be @jest/test-sequencer being listed in devDependencies of jest-core, and therefore not being installed by tools that only install from 'dependencies'.

Since packages/jest-core/src/runJest.ts will attempt to "require" @jest/test-sequencer (if a custom test-sequencer isn't set), it seems like @jest/test-sequencer needs to be listed as a dependency so it's always installed with jest-core, right?

@SimenB
Copy link
Member

SimenB commented Apr 3, 2019

It's a dep of jest-config, so #8267 will fix it as we'll pass a full, resolved path the @jest/core 馃檪

@scotthovestadt
Copy link
Contributor

Releasing fix shortly as 24.7.1

@SimenB
Copy link
Member

SimenB commented Apr 4, 2019

^ released

@SimenB SimenB closed this as completed Apr 4, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants