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

Unknown option: base.configFile error when running tests #5259

Closed
davidlukerice opened this issue Oct 3, 2018 · 58 comments
Closed

Unknown option: base.configFile error when running tests #5259

davidlukerice opened this issue Oct 3, 2018 · 58 comments
Milestone

Comments

@davidlukerice
Copy link
Contributor

davidlukerice commented Oct 3, 2018

Note from Maintainers

This is reportedly an issue with npm, as you will find below.

Please install Yarn as it's reportedly correctly hoisting packages, preventing this error.

If you'd like to continue using npm, run npm ls babel-core and remove offending packages that are relying on 6.x. Additionally, file a bug report with npm.


Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes
npm --version
6.4.1

Which terms did you search for in User Guide?

jest, test, babel, Unknown option: base.configFile

Environment

Environment:
OS: macOS 10.14
Node: 8.10.0
Yarn: 1.6.0
npm: 6.4.1
Watchman: 4.9.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.4.2 => 16.5.2
react-dom: ^16.4.2 => 16.5.2
react-scripts: 2.0.3 => 2.0.3

Steps to Reproduce

  1. Migrate from create-react-app v1.1.5 following the guide at https://github.com/facebook/create-react-app/releases
  2. Run the dev server and verify the app works correctly (npm start)
  3. Run all tests with npm test followed by a

Expected Behavior

Tests should run and complete

Actual Behavior

I get the following error on every test

Test suite failed to run

    ReferenceError: [BABEL] {redacted}/src/setupTests.js: Unknown option: base.configFile. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

    Invalid:
      `{ presets: [{option: value}] }`
    Valid:
      `{ presets: [['presetName', {option: value}]] }`

    For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options.

      at Logger.error (node_modules/babel-core/lib/transformation/file/logger.js:41:11)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
      at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
      at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)
      at new File (node_modules/babel-core/lib/transformation/file/index.js:135:24)
      at Pipeline.transform (node_modules/babel-core/lib/transformation/pipeline.js:46:16)

my setupTests.js file contains the following

import 'react-testing-library/cleanup-after-each';
import 'jest-dom/extend-expect';

Adding them to a fresh app doesn't cause an issue.

Reproducible Demo

This is an internal project, but I'll work to see if I can narrow it down at all and reproduce in a fresh install. So far I haven't figured it out.
I'm putting this issue up in the meantime to see if anyone else runs into it while migrating to v2. It also popped up at #5103 (comment), but clearing the node modules / lock / &c didn't help, nor did upgrading to node v10.

@Timer Timer added this to the 2.0.4 milestone Oct 3, 2018
@JustinTRoss
Copy link

JustinTRoss commented Oct 3, 2018

I had the same issue, and I'm using the same setupTests.js file, though removing this file has no effect on the outcome.

I was able to get rid of this error by deleting package-lock and reinstalling.

@Timer
Copy link
Contributor

Timer commented Oct 3, 2018

I'm not able to repo this. Can you provide a small isolated example please?

@Timer
Copy link
Contributor

Timer commented Oct 3, 2018

Please post your package.json.

@Timer Timer modified the milestones: 2.0.4, 2.0.x Oct 3, 2018
@JustinTRoss
Copy link

I do have jest-dom installed. Is there a reason why that dependency should be avoided when using CRA?

// package.json

"dependencies": {
    "@material-ui/core": "^3.1.0",
    "@material-ui/icons": "^3.0.1",
    "apollo-boost": "^0.1.16",
    "emotion": "^9.2.10",
    "graphql": "^14.0.2",
    "graphql-anywhere": "^4.1.19",
    "graphql-tag": "^2.10.0",
    "idx": "^2.4.0",
    "lodash": "^4.17.11",
    "raven-js": "^3.27.0",
    "react": "^16.5.2",
    "react-apollo": "^2.1.11",
    "react-dom": "^16.5.2",
    "react-emotion": "^9.2.10",
    "react-redux": "^5.0.7",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-scripts": "^2.0.3",
    "redux": "^4.0.0",
    "reselect": "^3.0.1"
  },
  "devDependencies": {
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-airbnb-base": "^13.1.0",
    "eslint-config-prettier": "^3.1.0",
    "eslint-plugin-flowtype": "^2.50.3",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-prettier": "^3.0.0",
    "eslint-plugin-react": "^7.11.1",
    "faker": "^4.1.0",
    "jest": "^23.6.0",
    "jest-dom": "^2.0.0",
    "lint-staged": "^7.3.0",
    "prettier": "^1.14.3",
    "react-testing-library": "^5.1.0",
    "rosie": "^2.0.1"
  }

@jambyung
Copy link

jambyung commented Oct 3, 2018

I was also able to fix this issue by deleting package-lock.json and node_modules folder and running npm install again.

@gaearon
Copy link
Contributor

gaearon commented Oct 3, 2018

Sounds like an npm issue then. Use the workaround above if you bump into this.

@gaearon gaearon closed this as completed Oct 3, 2018
@davidlukerice
Copy link
Contributor Author

I was repeatedly having this problem yesterday, even with the above workaround. I added the dependencies one by one back today and was able to add them back all in without incident, so who knows what npm was having trouble with.

@gustavobini
Copy link

I am having the same issue. Cleaning node_modules and installing again did not fix it.

"dependencies": {
    "react": "^16.4.2",
    "react-dom": "^16.4.2",
    "applicationinsights-js": "^1.0.19",
    "axios": "^0.18.0",
    "history": "^4.7.2",
    "mixpanel-browser": "^2.22.4",
    "prb-components": "^0.0.131",
    "qs": "^6.5.2",
    "react-lazyload": "^2.3.0",
    "react-loadable": "^5.5.0",
    "react-mobile-picker": "^0.1.12",
    "react-modal": "^3.4.4",
    "react-redux": "^5.0.7",
    "react-scripts": "2.0.3",
    "react-scroll": "^1.7.9",
    "redux": "^4.0.0",
    "redux-thunk": "^2.3.0",
    "string-to-arraybuffer": "^1.0.0",
    "styled-components": "^3.4.5",
    "styled-react-modal": "^0.2.1",
    "universal-router": "^6.0.0",
    "validator": "^10.1.0",
    "webfontloader": "^1.6.28"
  },
  "lint-staged": {
    "src/**/*.{js,jsx,json}": [
      "eslint --fix",
      "git add"
    ],
    "src/**/*.{scss,css}": [
      "stylelint --config=.stylelintrc --fix",
      "git add"
    ]
  },
  "jest": {},
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "build:development": "env-cmd .env.development npm run build",
    "build:staging": "env-cmd .env.staging npm run build",
    "build:production": "env-cmd .env.production npm run build",
    "postbuild": "node iisConfig/iisConfig.js",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "precommit": "lint-staged && jest",
    "eslint-all": "./node_modules/.bin/eslint --fix --ext=js --ext=jsx ./src/",
    "serve": "./node_modules/.bin/serve -s --ssl ./build"
  },
  "devDependencies": {
    "classnames": "^2.2.5",
    "cross-env": "^5.2.0",
    "env-cmd": "^8.0.2",
    "enzyme": "^3.4.4",
    "enzyme-adapter-react-16": "^1.2.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "^3.0.1",
    "eslint-plugin-prettier": "^2.6.2",
    "husky": "^0.14.3",
    "lint-staged": "^7.0.4",
    "npm-run-all": "^4.1.2",
    "prettier": "^1.11.1",
    "prop-types": "^15.6.1",
    "serve": "^6.5.8",
    "stylelint": "^9.2.0",
    "stylelint-config-standard": "^18.2.0"
  }

@jambyung
Copy link

jambyung commented Oct 3, 2018

@gustavobini what about deleting both package-lock and node_modules and installing again?

@gustavobini
Copy link

@gustavobini what about deleting both package-lock and node_modules and installing again?

Sorry, I meant to say I did both those things.

@arnvol
Copy link

arnvol commented Oct 3, 2018

Nothing new to bring to the table, but I'm having the same issue.

@jambyung
Copy link

jambyung commented Oct 3, 2018

I’m just assuming that If you have installed any package that required babel related packages then it could cause some issues with the new Babel 7. In my case I suspect storybook which required babel-core and babel-runtime alongside it. I removed storybook and any babel related packages before removing package-lock and node_modules. I don’t know if this fixed the issue but worth looking at.

@Timer Timer modified the milestones: 2.0.x, 2.0.4 Oct 3, 2018
@arnvol
Copy link

arnvol commented Oct 3, 2018

npm view babel-core
babel-core@6.26.3 | MIT | deps: 19 | versions: 257
Should have been 7 after upgrading to create-react-app 2.0.3?
Perhaps some deps holding me back..

@Timer
Copy link
Contributor

Timer commented Oct 3, 2018

Can someone please install Yarn, use Yarn instead of npm, and see if that fixes the problem?

@Timer
Copy link
Contributor

Timer commented Oct 3, 2018

I believe the appropriate command would be npm ls babel-core.

npm view babel-core provides no information related directly to your package tree.

@arnvol
Copy link

arnvol commented Oct 3, 2018

Right :-D

+-- jest-junit@5.2.0
| -- jest-config@23.6.0 | -- babel-core@6.26.3
| -- babel-register@6.26.0 | -- babel-core@6.26.3 deduped
+-- nka-button@1.0.3
| -- nk-standard@0.0.7 | -- babel-cli@6.26.0
| -- babel-core@6.26.3 deduped -- react-scripts@2.0.3
+-- babel-core@7.0.0-bridge.0
-- jest@23.6.0 -- jest-cli@23.6.0
-- jest-runtime@23.6.0 -- babel-core@6.26.3 deduped

@Timer
Copy link
Contributor

Timer commented Oct 3, 2018

/cc @gaearon it looks like there's some complex trickery going on here, shouldn't our package tree check be catching the wrong babel-core version?

@jambyung
Copy link

jambyung commented Oct 3, 2018

@arnvol FYI, here is my version of package tree of working project.
I created a new project with CRA and check again it exactly matches following tree.

$ npm ls babel-core
└─┬ react-scripts@2.0.3
  ├── babel-core@7.0.0-bridge.0
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      ├─┬ jest-config@23.6.0
      │ └─┬ babel-core@6.26.3
      │   └─┬ babel-register@6.26.0
      │     └── babel-core@6.26.3
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3

@gustavobini
Copy link

npm ls babel-core accused other libraries of being dependent on earlier versions of babel-core.

yarn install worked. Definitely a problem with npm.

@AcStugoo
Copy link

AcStugoo commented Oct 4, 2018

I was having the base.configFile issue locally, however my pipeline was building, linting and testing as expected. I thought it must have been something with my set up. I tried to use yarn but it didnt' fix the issue. I also tried various versions of node (currently 8.11.1)

In the end this solution from @davidlukerice worked for me.:

I was repeatedly having this problem yesterday, even with the above workaround. I added the dependencies one by one back today and was able to add them back all in without incident, so who knows what npm was having trouble with.

As a last resort I cloned create-react-app into a different folder and ported my files over, rebuilding the dependencies as I went, trying to track down the bad module, but nothing broke. So when I had everything working in the new app I copied the package.json file over to my old project, deleted the package-lock file, node_modules folder there and ran npm i. Now everything works as it should 🤷‍♂️

@JeffBaumgardt
Copy link

Has anyone raised an issue with NPM at all? I would rather not switch package managers and my workflow just because of this issue.

I would expect to have found more issues regarding this elsewhere but this is the only one I've found. If it's a problem with Jest perhaps we should also open an issue with Jest?

@Timer
Copy link
Contributor

Timer commented Oct 5, 2018

@JeffBaumgardt I'm not sure I follow how this is a problem with Jest. The install works perfectly fine when using Yarn, and in some cases when you get npm to behave in certain ways. This issue definitely lies on npm's side.

@JaccoGoris
Copy link

@bugzpodder you probably did this but just to be sure; did you run all tests or just npm test. If I don’t run all, it doesn’t happen because it doesn’t run any tests of course. Just making sure that’s not it

@bugzpodder
Copy link

bugzpodder commented Oct 10, 2018

Actually, i was able to get a repo using your steps.

@bugzpodder
Copy link

bugzpodder commented Oct 10, 2018

Currently I have 4 clones running npm, two of them has the initial error, two of them works successfully =/
There are no differences in the output of npm ls and du -ah ./ between the working repos and the non-working repos.

Haven't been able to reproduce with yarn.

@jambyung
Copy link

jambyung commented Oct 10, 2018

Hi, @JaccoGoris I cloned your repo and got the same config error.
At first I thought it could be node issue so used 6.14.4, 7.10.1, but all failed.

I had the same issue with my repo and I found that the issue could be from babel-core still using 6.26.3 for some packages so I compared the dependency tree of both my project and yours.

$ npm ls babel-core

My project:

└─┬ react-scripts@2.0.3
  ├── babel-core@7.0.0-bridge.0
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      ├─┬ jest-config@23.6.0
      │ └─┬ babel-core@6.26.3
      │   └─┬ babel-register@6.26.0
      │     └── babel-core@6.26.3
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3

Your project:

├─┬ jest-junit@5.2.0
│ └─┬ jest-config@23.6.0
│   └─┬ babel-core@6.26.3
│     └─┬ babel-register@6.26.0
│       └── babel-core@6.26.3  deduped
└─┬ react-scripts@2.0.4
  ├── babel-core@7.0.0-bridge.0
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3  deduped

I found that on my project, babel-core@7.0.0-bridge.0 is on the top level of the dependency tree, above any other subtrees that uses babel 6.26.3.

So I did following and npm test worked like a charm.

  • uninstall jest-junit
  • remove package-lock.json
  • remove node_modules
  • run npm install again

And the dependency tree of babel-core should look like following when you run npm ls babel-core:

└─┬ react-scripts@2.0.4
  ├── babel-core@7.0.0-bridge.0
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      ├─┬ jest-config@23.6.0
      │ └─┬ babel-core@6.26.3
      │   └─┬ babel-register@6.26.0
      │     └── babel-core@6.26.3
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3

Hope this helps.

Edit: seems like explicitly installing babel-core@7.0.0-bridge.0 also solves the issue.
And make sure you clear jest cache before re-trying. With jest cache every subsequent test will succeed

$ npm install -D babel-core@7.0.0-bridge.0

npm ls babel-core will show following:

├── babel-core@7.0.0-bridge.0
├─┬ jest-junit@5.2.0
│ └─┬ jest-config@23.6.0
│   └─┬ babel-core@6.26.3
│     └─┬ babel-register@6.26.0
│       └── babel-core@6.26.3
└─┬ react-scripts@2.0.4
  ├── babel-core@7.0.0-bridge.0
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3

@erikrenberg
Copy link

Hmm that’s too bad. I’ll try the same steps. For me, these are the specific steps;

  • use npx create-react-app my-app to make the project.
  • copy the dependencies and devDependencies into the package.json
  • npm install again.
  • tests failed

I ran into this issue following those exact steps while porting our previuosly ejected app to cra2.

However I managed to get it work by running npm install on the empty cra2 app first, and THEN copying the dependencies etc into package json and doing npm install again. This apparently fixes the structure in node_modules and package-lock.json. Tests run fine.

It also works on other computers because presumably package-lock.json has preserved the right structure.

@JaccoGoris
Copy link

@jambyung following your step did work, so there must indeed be a tree issue somewhere. without jest-junit the tests ran fine, both in the repo project and my own actual project! so you are very likely on the right path here.

@jambyung
Copy link

jambyung commented Oct 10, 2018

@JaccoGoris Good to hear that! I also found that explicitly installing the bridge package with npm install -D babel-core@7.0.0-bridge.0 also fixes the issue without uninstalling jest-junit.

So I think there are 2 methods that you can try to fix this issue.

  1. remove package-lock.json, node_modules, and re-install packages.
  2. If method 1 does not solve, simply install babel-core@7.0.0-bridge.0 package ( preferably into your devDependencies ).

I recommend running npm ls babel-core to figure out which package is causing problem inside your dependency tree first.

@arnvol
Copy link

arnvol commented Oct 10, 2018

@jambyung thanks a lot! 2. method worked.

@JaccoGoris
Copy link

JaccoGoris commented Oct 10, 2018

@JaccoGoris Good to hear that! I also found that explicitly installing the bridge package with npm install -D babel-core@7.0.0-bridge.0 also fixes the issue without uninstalling jest-junit.

So I think there are 2 methods that you can try to fix this issue.

  1. remove package-lock.json, node_modules, and re-install packages.
  2. simply install babel-core@7.0.0-bridge.0 package.

@jambyung you might want to add: uninstall jest-junit to the first step, without that it doesn't work.

@arnvol
Copy link

arnvol commented Oct 10, 2018

@JaccoGoris in my case the second method works along with jest-junit.

@JaccoGoris
Copy link

@arnvol Oh yeah I know but in my case, I figured out I could go without jest-junit and it was much easier to just remove it than to add the babel bridge :)

@behnammodi
Copy link

@jambyung thanks

@loganfsmyth
Copy link

loganfsmyth commented Oct 14, 2018

Weird, definitely a package installation issue. babel-jest needs to be able to get Babel 7 via it's peerDependency, and react-scripts has dependencies on babel-core@7.0.0-bridge.0 and babel-jest, so that should be satisfied, but it looks like either babel-jest is being hoisted too much, or babel-core isn't being hoisted enough, so another copy of it gets hoisted in its place.

I'd expect

node_modules/
  babel-jest
  babel-core@7.0.0-bridge.0
  react-scripts/

or

node_modules/
  react-scripts/
    node_modules/
      babel-jest
      babel-core@7.0.0-bridge.0

but instead you've ended up with

node_modules/
  babel-jest
  babel-core@6
  react-scripts/
    node_modules/
      babel-core@7.0.0-bridge.0

so that babel-jest gets the wrong version of Babel.

@bugzpodder
Copy link

@loganfsmyth I have the exact same tree in two different repos and they gave the different results. What am I missing?

$ cd ~/dev3/jest-cra-app/
$ npm ls babel-core && CI=true npm run test
jest-cra-app@0.1.0 /Users/jzhao/dev3/jest-cra-app
├─┬ jest-junit@5.2.0
│ └─┬ jest-config@23.6.0
│   └─┬ babel-core@6.26.3 
│     └─┬ babel-register@6.26.0
│       └── babel-core@6.26.3  deduped
└─┬ react-scripts@2.0.4
  ├── babel-core@7.0.0-bridge.0 
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3  deduped


> jest-cra-app@0.1.0 test /Users/jzhao/dev3/jest-cra-app
> react-scripts test

PASS src/App.test.js
  ✓ renders without crashing (21ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.185s
Ran all test suites.
$ cd ~/dev2/jest-cra-app/
$ npm ls babel-core && CI=true npm run test
jest-cra-app@0.1.0 /Users/jzhao/dev2/jest-cra-app
├─┬ jest-junit@5.2.0
│ └─┬ jest-config@23.6.0
│   └─┬ babel-core@6.26.3 
│     └─┬ babel-register@6.26.0
│       └── babel-core@6.26.3  deduped
└─┬ react-scripts@2.0.4
  ├── babel-core@7.0.0-bridge.0 
  └─┬ jest@23.6.0
    └─┬ jest-cli@23.6.0
      └─┬ jest-runtime@23.6.0
        └── babel-core@6.26.3  deduped


> jest-cra-app@0.1.0 test /Users/jzhao/dev2/jest-cra-app
> react-scripts test

FAIL src/App.test.js
  ● Test suite failed to run

    ReferenceError: [BABEL] /Users/jzhao/dev2/jest-cra-app/src/App.test.js: Unknown option: base.configFile. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

    Invalid:
      `{ presets: [{option: value}] }`
    Valid:
      `{ presets: [['presetName', {option: value}]] }`

    For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options.

      at Logger.error (node_modules/babel-core/lib/transformation/file/logger.js:41:11)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.337s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jest-cra-app@0.1.0 test: `react-scripts test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the jest-cra-app@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/jzhao/.npm/_logs/2018-10-14T18_13_39_336Z-debug.log

@loganfsmyth
Copy link

@bugzpodder It is the relative placement of babel-core@7.0.0-bridge.0 and babel-jest that is important, so most likely babel-jest is in a different place in the two cases.

@bugzpodder
Copy link

Looks like I am actually having some caching issues.
I was able to add a blank line to node_modules/babel-jest/build/index.js and get my successful run into a failure. Removing the blank line would result in success.

@ghost
Copy link

ghost commented Oct 23, 2018

I was also able to fix this issue by deleting package-lock.json and node_modules folder and running npm install again.

This works for me! Using react-scripts@2.0.5

@marcysutton
Copy link

marcysutton commented Oct 31, 2018

If you delete package-lock.json and node_modules and the problem still won't go away after a fresh install, double check package.json for an older explicit babel-core entry (mine had "^6.26.0" for some reason). You can remove it for Babel 7 since that became a dependency of react-scripts. Then go through the delete/reinstall steps again.

@karianpour
Copy link

I had the same issue, using "react-scripts": "^1.1.5" solved the problem.

@Fl4v10
Copy link

Fl4v10 commented Nov 22, 2018

I had the same issue, using "react-scripts": "^1.1.5" solved the problem.

I realized that my react-scripts-ts was in a diferenf version from react-scripts, then I just remove.

@kuba775
Copy link

kuba775 commented Nov 27, 2018

For some unknown reason deleting node_modules and package-lock.json and even resetting my project repository to original state didn't work. I tried it about hundred times in a day, reinstalled npm and so on, but still no success...

Then I just renamed the project folder to something else (with cleared node_modules and package-lock.json), run npm install and tests started to run again. Renaming the project back to original name still kept it working. Probably something was hanging there in a path... so maybe it can help to someone - at least one more thing to try.

I've also created new create-react-app somewhere else in the filesystem during the same time, so not sure if that had any effect... but just in case

@oalberto96
Copy link

When i updated my react-scripts from 1.1.15 to 2.1.1 i had the same issue. I solved it by deleting the package-lock.json file, the node_modules folder, and deleting the jest reference from the package.json.
Then i ran the npm install and after that install jest

@JustenRickert
Copy link

I was getting this error and was able to fix it by doing rm ~/.npm/_cacache/ and reinstalling node_modules. This worked for me since around October, but just started not working since about a day ago. I was able to solve the problem now by doing npm install -D babel-core@7.0.0-bridge.0, which I think was a transitive dependency previously.

@alfonmga
Copy link

I had to replace "babel-core": "^6.26.3" to "babel-core": "7.0.0-bridge.0" in my package.json to make it works.

@IanFelton
Copy link

npm install -D babel-core@7.0.0-bridge.0 was the simple fix for me.

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests