-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Description
🐛 Bug Report
Keep getting "Error: Cannot find module '@babel/traverse'" when running jest.
Original report : kulshekhar/ts-jest#2684
Have installed the required packages and separately installed. @babel/traverse which didn't help either.
To Reproduce
Steps to reproduce the behavior:
if using package.json as belows ( using npm install -D typescript jest ts-jest @types/jest)
{
"devDependencies": {
"@types/jest": "^26.0.23",
"jest": "^27.0.4",
"ts-jest": "^27.0.3",
"typescript": "^4.3.3"
}
}
Expected behavior
run ts-jest
Link to repl or repo (highly encouraged)
https://github.com/bromix/typescript-jest-example
if using the following package.json, it works
"devDependencies": {
"@types/jest": "^26.0.20",
"jest": "^26.6.3",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
}
Debug log:
keep getting "Error: Cannot find module '@babel/traverse'" when running jest. node version v12.4.0
Error: Cannot find module '@babel/traverse'
Require stack:
/Users/external-contacts-hub/node_modules/jest-snapshot/build/InlineSnapshots.js
/Users/external-contacts-hub/node_modules/jest-snapshot/build/State.js
/Users//external-contacts-hub/node_modules/jest-snapshot/build/index.js
/Users/external-contacts-hub/node_modules/jest-runtime/build/index.js
/Users/external-contacts-hub/node_modules/@jest/core/build/cli/index.js
/Users/external-contacts-hub/node_modules/@jest/core/build/jest.js
/Users/external-contacts-hub/node_modules/jest/node_modules/jest-cli/build/cli/index.js
/Users/external-contacts-hub/node_modules/jest/node_modules/jest-cli/bin/jest.js
/Users/external-contacts-hub/node_modules/jest/bin/jest.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
at Function.resolve (internal/modules/cjs/helpers.js:21:19)
at Object. (/Users/external-contacts-hub/node_modules/jest-snapshot/build/InlineSnapshots.js:72:17)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object. (/Users/external-contacts-hub/node_modules/jest-snapshot/build/State.js:13:24)
envinfo
System:
OS: MacOs Big Sur Version 11.3.1
Node version: v12.4.0
Npm packages:
jest:
ts-jest:
typescript:
babel(optional):