-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module '@babel/traverse' #11590
Comments
自分もnode v12.4.0で実行した場合同じ現象が発生しました。 I had the same problem when running on node v12.4.0. |
Please provide a minimal reproduction without using |
I had the same problem.
tested in this problem does NOT occur in node v14.17.1 and v12.22.1 |
Have been getting the same error with given config { System: |
I have the same problem.
The package I installed is only jest (and its dependencies).
After down grading jest to 26.6.3, the problem was also resolved. |
same issue with node v12; switch node to v15 and reinstall node_module, problem solved |
Thanks for the reproduction @sdkawata, sorry I missed it!
Minimum supported node version (of v12) is 12.13: https://github.com/facebook/jest/blob/42b020f2931ac04820521cc8037b7c430eb2fa2f/package.json#L148, so if the issue is only with 12.4 we can close this. Can anyone provide a reproduction using a supported version of node? Note that |
Thank you for the reply.
Sorry for not checking minimum supported version. I checked my reproduction in node v12.13.0, v14.15.0, v15.0.0, and confirmed that the problem does not occur in node v12.13.0, v14.15.0, v15.0.0. I dig into this error, and find that error throw from require.resolve function in requireOutside function defined here.
So, I think we can close this issue because this problem may not occur in supported node version. |
Great, thanks for digging into the root cause @sdkawata! |
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. |
🐛 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):
The text was updated successfully, but these errors were encountered: