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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest not working on fresh install #548

Closed
TheDutchCoder opened this issue Feb 1, 2018 · 3 comments
Closed

Jest not working on fresh install #548

TheDutchCoder opened this issue Feb 1, 2018 · 3 comments

Comments

@TheDutchCoder
Copy link

TheDutchCoder commented Feb 1, 2018

Description

npm run test fails on a new project (ejected)

Expected Behavior

I'd expect Jest to be installed and to run when npm run test is called.

Observed Behavior

I receive an error saying that jest/bin/jest.js can't be found. (I anonymized some data)

npm run test

> ---@0.1.0 test /Users/---/projects/---
> node node_modules/jest/bin/jest.js

module.js:327
    throw err;
    ^

Error: Cannot find module '/Users/---/projects/---/node_modules/jest/bin/jest.js'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:140:18)
    at node.js:1043:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ---@0.1.0 test: `node node_modules/jest/bin/jest.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ---@0.1.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/---/.npm/_logs/2018-02-01T14_59_32_916Z-debug.log

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts:
---@0.1.0 /Users/---/projects/---
└── (empty)
  • npm ls react-native:
---@0.1.0 /Users/---/projects/---
└── react-native@0.52.0
  • npm ls expo:
---@0.1.0 /Users/---/projects/---
└── (empty)
  • node -v: v6.12.3
  • npm -v: 3.10.10
  • yarn --version: zsh: command not found: yarn
  • watchman version: zsh: command not found: watchman

Also specify:

  1. Operating system: macOS High Sierra (10.13.3)
  2. Phone/emulator/simulator & version: Simulator 10.0

Reproducible Demo

N/A (it's a new, ejected, install)

@yacinehmito
Copy link
Contributor

It's because jest is not included among the dev dependencies. I'll submit a PR shortly.

yacinehmito added a commit to yacinehmito/create-react-native-app that referenced this issue Feb 4, 2018
brentvatne pushed a commit that referenced this issue Feb 16, 2018
@TallOrderDev
Copy link

Should this still be open?

@TheDutchCoder
Copy link
Author

Nope, was merged in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants