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

React Scripts issues with Babel Loader #8693

Closed
DimitriMichel opened this issue Mar 22, 2020 · 4 comments
Closed

React Scripts issues with Babel Loader #8693

DimitriMichel opened this issue Mar 22, 2020 · 4 comments

Comments

@DimitriMichel
Copy link

DimitriMichel commented Mar 22, 2020

Describe the bug

When creating a new react-app and running npm start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"babel-loader": "8.1.0"

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hooks@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hooks@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:

/Users/dimitri/node_modules/babel-loader (version: 8.0.6)

Did you try recovering your dependencies?

I did the following steps and the issue persists:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-loader" from dependencies and/or devDependencies in the package.json file
    in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

Have you done all these steps and still see the issue?
Please paste the output of npm --version and/or yarn --version to confirm.
-->
(base) Dimitris-MBP:hooks dimitri$ npm --version
6.13.1

Environment

I'm using Webstorm on a MBP running macOS 10.14 Mojave.

Environment Info:

current version of create-react-app: 3.4.1
running from /usr/local/lib/node_modules/create-react-app

System:
OS: macOS Mojave 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 13.2.0 - /usr/local/bin/node
Yarn: 1.21.0 - /usr/local/bin/yarn
npm: 6.14.3 - ~/Documents/hooks/node_modules/.bin/npm
Browsers:
Chrome: 80.0.3987.149
Firefox: 73.0.1
Safari: 12.0
npmPackages:
react: ^16.13.1 => 16.13.1
react-dom: ^16.13.1 => 16.13.1
react-scripts: 3.4.1 => 3.4.1
npmGlobalPackages:
create-react-app: 3.4.1

@luisrudge
Copy link

did you fix this?

@DimitriMichel
Copy link
Author

DimitriMichel commented Mar 24, 2020 via email

@Mat20
Copy link

Mat20 commented Mar 26, 2020

Just follow the instructions in the TERMINAL that will work.
Delete package-lock.json (not package.json!) And / or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "babel-loader" from dependencies and / or devDependencies in the package.json file
in your project folder.
Run npm install or yarn, depending on the package manager you use.

I didn't understand it at first but I ended up falling on the page and translating it into my language so I could solve the problem ..

Hugs, thank you very much ...

@adrianmcli
Copy link

If anyone is interested, I had the same problem.

Turns out I had babel-loader installed in a node_modules folder from a parent folder.

@lock lock bot locked and limited conversation to collaborators Apr 4, 2020
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

4 participants