score:53

Accepted answer

There is a conflict in the casing

C:\Users\Ruben|desktop\reactapp\test.... whereas the nodemodules is looking for C:\Users\Ruben|Desktop\Reactapp\test....

This is a windows specific problem, and previously react would have run the app regardless of this difference. Not anymore it seems.

The solution I used was to locate the folder and open with code; that ensures that the path matches directly with what is stored in node modules

score:-3

Nothing Complicated Just Delete "package-lock.json" file

score:0

Had the same problem with the name case. When creating the project, had named it "React2", but VS ignored my case and named the project's folder "react2" (lowercase) instead. The solution was to:

  1. Close Visual Studio.
  2. Rename the folder. That is, make the case match the project name. (From a git-bash shell: mv react2 React2 to fix the name case.)
  3. Open Visual Studio, and try again.

score:0

I had the same issue as you, and i got tired doing Ctrl + S on package.json, which is a one of the solutions. Another way to solve that is your path you have Desktop (D uppercase) and the path that the error show to you have desktop (d lowercase) so you can rename that folder to desktop and it will solve the problem

score:0

I had this issue after updating mui. None of the above solutions worked for me. Eventually, I ran npm dedupe a bunch of time and found all of the conflicted dependencies. After making a bunch of edits to my package.json and npm installing, this error went away.

score:0

I changed folder name, but I run the app from terminal in old folder name.

old Folder name: C:/.../ReactRepo/ReduxExample1 changed name: C:/.../ReactRepo/reduexample1

How I solve from terminal:

cd .. && cd reduexample1(paste here your new Folder Name) && npm start

score:0

This is an ongoing issue for me that appears when I edit and save any files and react tries to recompile. My temporary fix is whenever I save a file, I click on my package.json file, which I have constantly open on the side, and save. Then it compiles fine.

score:0

I solved this problem by deleting the eslint-config-react-app folder manually from node_modules and running yarn add eslint-config-react-app again.

score:0

Solution worked for me.

npm remove eslint-config-react-app

Tried reinstalling eslint but throwing the same error. Just removing worked fine for me.

score:1

I fixed this issue doing this in package.json file:

"eslintConfig": {
"extends": "react-app" //remove this line
},

score:2

Windows 10 with VS Code user. I re-installed es-lint-config-react-app with yarn, or npm if you use it. and everything seems to be fixed so far.

score:3

I got this error when installing React with Visual Studio 2022 Standalone React project. The problem was Visual Studio showed my project name in Capitalized (as I typed), however, the folder name was in small-caps.

The fix was to manually rename the folder name to match the project name as shown in Visual Studio.

score:4

I also ran into this problem on a Mac. As a temporary workaround, I was able to fix this by downgrading to version 6, by running

yarn remove eslint-config-react-app

followed by

yarn add eslint-config-react-app@6

I ran this twice. Always failed with version 7 (eslint-config-react-app without the "@6"), and always succeeded with version 6. YMMV, especially if you really need version 7.

score:5

Just re-save package.json, that worked for me.

score:7

The error occurred from the terminal, i had similar issues for a long time trying series of things from trying to update my dependencies using "npm install" to saving the package.json file, but all this approach will only fix the issue temporarily. The best and permanent solution is for you to cd into the project correctly from your terminal, the latest react is sensitive to the casing. e.g. you cd into C:\Users\Desktop\reacttutorials\antd-demo while the correct path is C:\Users\Desktop\ReactTutorials\antd-demo

Note the change in the casing.

score:27

Faced with the same issue on Windows 10 & VS Code & npm. As a workaround, open the package.json file in VS Code and save it (ctrl+s), then it works. You may need to repeat this step each time, a bit annoying.


Related Query

More Query from same tag