"npm start" error if there is a .babelrc file in parent folder
See original GitHub issueif 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:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done by the amazing @alexzherdev in #236! 👍
Can you verify 0.2.0 alpha fixes this? https://github.com/facebookincubator/create-react-app/pull/190