question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"npm start" error if there is a .babelrc file in parent folder

See original GitHub issue

if I have a folder named “React” or some other name. run create-react-app test-react in folder React cd ./test-react run npm start it works fine;

but if I put a .babelrc file in folder “React” echo "{presets: ['es2015']}" > ../.babelrc and run npm start if will cause a error: Failed to compile. Error in ./src/index.js Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/forclan/Documents/Javascript/React" at Array.map (native) @ multi main

It seems that react-scripts will find a .babelrc file the way up to “~”(if i put the .babelrc file in my home folder,it will generate the same error);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mxstbrcommented, Jul 27, 2016

Done by the amazing @alexzherdev in #236! 👍

0reactions
gaearoncommented, Jul 27, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with babel-jest dependency when running npm start in a ...
This problem can occur if there is node_modules in a parent directory of the folder where you run the application.
Read more >
Config Files - Babel.js
This establishes Babel's core concept of the base directory of your repository. Even if you want to use .babelrc.json files to configure each...
Read more >
next-transpile-modules - npm
I have trouble with transpilation and my custom .babelrc ... If you get a transpilation error when using a custom Babel configuration, make...
Read more >
Creating a React app with Webpack - JavaScript Ramblings
Now, let's try it out! After running npm run build , you should see a new folder was created, called build , with...
Read more >
Cannot start mflix-js with npm start - M220JS - MongoDB
Please check if you have .babelrc file in your directory. Run ls .babelrc from mflix-js directory where all your files are present. 42%20PM....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found