Jo Micheal
10 Jun 2021
React js
Hello there,
Please I am facing a big error in my new react js app
Failed to compile.
./src/Homepage.js
Cannot find file: 'index.js' does not match the corresponding name on disk: '.\node_modules\React\react'.
and the screenshot is attached below,
Please help :(
Welcome back, Jo
Nice to see you again,
This is a common error that happens for beginners so all you need to do is just fix the name of react library at the first line so it should be react with small r instead of React
import React from 'react';
//Instead of
import React from 'React';
Jo Micheal
10 Jun 2021
Works fine!! thanks :)
Stephen Jones
21 Sep 2021
I have the same error but it is not because of the index.js import statement which is:
import React from 'react';
The actual message suggests an issue with node modules:
Cannot find file: 'index.js' does not match the corresponding name on disk: './node_modules/React/react'.
There isn't a reference to React/react in the node modules
any other suggestions? This is driving me crazy!
Jo Micheal
21 Sep 2021
Hey Stephen i suggest if you re-installed the reactjs
npx create-react-app my-app
cd my-app
npm start
or you can update the npm packages by
npm update
let me know if you solved the issue
Best regards
yash dikshit
26 Nov 2021
i am applying your method but same error occured
yash dikshit
26 Nov 2021
./src/component/Navbar.js
Cannot find file: 'index.js' does not match the corresponding name on disk: '.\node_modules\Prop-types\prop-types'.
© 2024 Copyrights reserved for web-brackets.com