Skip to content

Jest not working on fresh install #548

@TheDutchCoder

Description

@TheDutchCoder

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

> [email protected] 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! [email protected] test: `node node_modules/jest/bin/jest.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:
[email protected] /Users/---/projects/---
└── (empty)
  • npm ls react-native:
[email protected] /Users/---/projects/---
└── [email protected]
  • npm ls expo:
[email protected] /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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions