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 'request' #5352
Comments
Something is up with your installed tree, doing Also, you should install the babel core bridge if you're using babel 7 (see https://facebook.github.io/jest/docs/en/getting-started.html#additional-configuration) |
@SimenB Thanks, it works now. I think the docs are outdated with regards to babel-jest though, because 'babel-core@^7.0.0-0' is not found. |
It works on my machine. $ mkdir test
$ cd test
$ yarn init -y
$ yarn add babel-core@^7.0.0-0
success Saved 1 new dependency.
└─ babel-core@7.0.0-bridge.0 |
@SimenB Maybe this is a difference between NPM and Yarn? Or maybe you had the package in your cache? This is what it looks like to me:
Debug log:
Then I figured it might have to do with the apostrophes, so I tried without them:
Debug log:
|
That's very odd. $ npm cache clear --force
$ npm init -y
$ npm i -D babel-core@^7.0.0-0 --verbose
npm info it worked if it ends with ok
npm verb cli [ '/Users/simen/.nvm/versions/node/v8.9.4/bin/node',
npm verb cli '/Users/simen/.nvm/versions/node/v8.9.4/bin/npm',
npm verb cli 'i',
npm verb cli '-D',
npm verb cli 'babel-core@^7.0.0-0',
npm verb cli '--verbose' ]
npm info using npm@5.6.0
npm info using node@v8.9.4
npm verb npm-session b1d0b0c362b122f1
npm http fetch GET 200 https://registry.npmjs.org/babel-core 424ms
npm verb correctMkdir /Users/simen/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /Users/simen/.npm/_locks/staging-3b7229d1667142d2.lock for /Users/simen/Development/ugh/node_modules/.staging
http fetch GET 200 https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz 199ms7229d1667142d2.lock for /Users/simen/Development/ugh/node_modules/.staging
npm info lifecycle babel-core@7.0.0-bridge.0~preinstall: babel-core@7.0.0-bridge.0
npm info linkStuff babel-core@7.0.0-bridge.0
npm verb linkBins babel-core@7.0.0-bridge.0
npm verb linkMans babel-core@7.0.0-bridge.0
npm info lifecycle babel-core@7.0.0-bridge.0~install: babel-core@7.0.0-bridge.0
npm info lifecycle babel-core@7.0.0-bridge.0~postinstall: babel-core@7.0.0-bridge.0
npm verb unlock done using /Users/simen/.npm/_locks/staging-3b7229d1667142d2.lock for /Users/simen/Development/ugh/node_modules/.staging
npm verb saving [ { name: 'babel-core',
npm verb saving spec: '^7.0.0-bridge.0',
npm verb saving save: 'devDependencies' } ]
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN babel-core@7.0.0-bridge.0 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN ugh@1.0.0 No description
npm WARN ugh@1.0.0 No repository field.
+ babel-core@7.0.0-bridge.0
added 1 package in 1.706s
npm verb exit [ 0, true ]
npm info ok |
Strange indeed...! I can only install the bridge by explicitly stating
|
I can only guess a windows bug with npm... You can try opening up an issue with them? |
I had the same problem. |
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. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I run Jest, it fails immediately with
Cannot find module 'request'
, but I don't requirerequest
myself, it's part of the Jest dependency tree.If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.I've pushed a branch named
wtf-jest
to a branch that you can test it out on: https://github.com/denizdogan/nima/tree/wtf-jestWhat is the expected behavior?
I expect Jest to run my test suites.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
NPM 5.6.0
Node.js 9.4.0
Jest 22.1.4
Windows 10 (64-bit)
The text was updated successfully, but these errors were encountered: