create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Babel Error on start - clean app

Open skoliver89 opened this issue 7 years ago • 15 comments

Describe the bug

I created a new/clean react app and on first run of the start script with no edits I get a Babel Error. See below for my CLI outout.

$ npx create-react-app price-grid
npx: installed 91 in 6.335s

Creating a new React app in C:\Users\soliver\Documents\react_module_dev\price-grid.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


> [email protected] postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-runtime\node_modules\core-js
> node postinstall || echo "ignore"


> [email protected] postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js
> node scripts/postinstall || echo "ignore"


> [email protected] postinstall C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

+ [email protected]
+ [email protected]
+ [email protected]
added 1483 packages from 695 contributors and audited 904941 packages in 50.992s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


Initialized a git repository.

Success! Created price-grid at C:\Users\soliver\Documents\react_module_dev\price-grid
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd price-grid
  npm start

Happy hacking!

soliver@IS-SO-WIN10 MINGW64 /c/Users/soliver/Documents/react_module_dev
$ cd price-grid/

soliver@IS-SO-WIN10 MINGW64 /c/Users/soliver/Documents/react_module_dev/price-grid (master)
$ npm start

> [email protected] start C:\Users\soliver\Documents\react_module_dev\price-grid
> react-scripts start

Starting the development server...

Failed to compile.

./node_modules/react-dev-utils/webpackHotDevClient.js
Error: [BABEL] C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\react-dev-utils\webpackHotDevClient.js: Cannot find module './src/data'
Require stack:
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-compat\helpers.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\core-js-compat\get-modules-list-for-target-version.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\node_modules\@babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\node_modules\@babel\preset-env\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-preset-react-app\dependencies.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\config\files\plugins.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\config\files\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\@babel\core\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\babel-loader\lib\index.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\loader-runner\lib\LoaderRunner.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\NormalModule.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\NormalModuleFactory.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\Compiler.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\webpack\lib\webpack.js
- C:\Users\soliver\Documents\react_module_dev\price-grid\node_modules\react-scripts\scripts\start.js (While processing: "C:\\Users\\soliver\\Documents\\react_module_dev\\price-grid\\node_modules\\babel-preset-react-app\\dependencies.js$0$9")


Did you try recovering your dependencies?

Followed the Recommended fix steps and issue persists.

NPM Version: 6.13.1

Which terms did you search for in User Guide?

'npm start error' 'babel error' 'npm start babel error'

Environment

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1285 v6 @ 4.10GHz
  Binaries:
    Node: 13.2.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.13.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0
    Internet Explorer: 11.0.18362.1
  npmPackages:
    react: ^16.12.0 => 16.12.0
    react-dom: ^16.12.0 => 16.12.0
    react-scripts: 3.2.0 => 3.2.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. run npx create-react-app app-name
  2. enter command cd app-name
  3. enter command npm start

Expected behavior

Opens default react app in browser (no errors)

Actual behavior

Error output in CLI and Browser: (see description for CLI Error output) image

Reproducible demo

I didn't change anything from what is provide immediately after running create-react-app

skoliver89 avatar Dec 02 '19 18:12 skoliver89

I have the same issue

NielXu avatar Dec 02 '19 19:12 NielXu

I experience the same issue. Worked fine a week ago.

im-stuart avatar Dec 02 '19 19:12 im-stuart

Same issue for all 25 of my students.

CRHarding avatar Dec 02 '19 19:12 CRHarding

Same

Oswirrex avatar Dec 02 '19 19:12 Oswirrex

This is happening to me as well

oohwooh avatar Dec 02 '19 19:12 oohwooh

Same for me, was working fine 2 hours ago

bourdakos1 avatar Dec 02 '19 19:12 bourdakos1

react-scripts stoped to work for me by this error (as I cleaned the node_modules)

lfernando-silva avatar Dec 02 '19 19:12 lfernando-silva

Same here.

nicolairhs avatar Dec 02 '19 19:12 nicolairhs

Looks like it's because the npm cache hasn't been updated yet, it's a bug in core-js-compat https://github.com/zloirock/core-js/issues/713

should fix itself soon?

oohwooh avatar Dec 02 '19 19:12 oohwooh

The fix has been released 1 hour ago but it isn't downloaded by npm: https://github.com/npm/cli/issues/545 Please :+1: that issue.

nicolo-ribaudo avatar Dec 02 '19 19:12 nicolo-ribaudo

Well... isn't that niffty. Thanks for the heads up!

skoliver89 avatar Dec 02 '19 19:12 skoliver89

If you need it to work now and you cant wait for npm to be updated, you can run this: npm install [email protected] It made it work for me at least.

jawee avatar Dec 02 '19 19:12 jawee

if you run npm i -D [email protected] it should resolve the problem. Worked for me. https://github.com/parcel-bundler/parcel/issues/3864#issuecomment-560541229

oohwooh avatar Dec 02 '19 19:12 oohwooh

Sounds like we this issue is out to the hands of this team. We also have interim fixes provided by @jawee and @DragonBallZeke Therefore, I am going to close my issue.

Thanks for all of the support my dudes! 😄

skoliver89 avatar Dec 02 '19 19:12 skoliver89

just as an update:

Looks like npm got their stuff fixed. It should work now as intended. (I just verified it on my machine)

npm steps:

  1. delete node_modules & package-lock
  2. remove core-js-compat from package.json dependencies if you installed it
  3. run npm install

As the create react app team likes to say... "Happy Hacking!" 😄

skoliver89 avatar Dec 02 '19 19:12 skoliver89