Home > Blockchain >  How do i resolve the compilation error on my react app?
How do i resolve the compilation error on my react app?

Time:12-03

[eslint] Plugin "react" was conflicted between "package.json » eslint-config-rea ct-app » C:\Users\user\desktop\robofriends\node_modules\eslint-config-react-app\ base.js" and "BaseConfig » C:\Users\user\Desktop\robofriends\node_modules\eslint -config-react-app\base.js". ERROR in [eslint] Plugin "react" was conflicted between "package.json » eslint-c onfig-react-app » C:\Users\user\desktop\robofriends\node_modules\eslint-config-r eact-app\base.js" and "BaseConfig » C:\Users\user\Desktop\robofriends\node_modul es\eslint-config-react-app\base.js".

I tried re-install everything from the start all over but still didnt work.

CodePudding user response:

It looks like you are encountering an error with the eslint plugin for React. To fix this error, try the following steps:

1.Check your package.json file to make sure that you have only one version of the eslint-config-react-app package installed. If you have multiple versions installed, try removing one of them.

2.If step 1 does not fix the problem, try running the npm ls eslint command to list all of the installed versions of the eslint package. This will help you identify any conflicts between different versions of the package.

3.If you are still unable to resolve the error, try uninstalling and reinstalling the eslint-config-react-app package. This may help to reset any conflicting configurations.

4.If none of the above steps work, you may need to manually edit your eslint configuration to resolve the conflict. You can find more information about how to do this in the eslint documentation.

CodePudding user response:

It looks like you are encountering a conflict between two different versions of the eslint-plugin-react package. One version is specified in your package.json file, while the other version is specified in the eslint-config-react-app package.

To resolve this error, you will need to make sure that you are using the same version of the eslint-plugin-react package in both places.

To do this, you can run the following command in your project's root directory:

npm ls eslint-plugin-react

This will show you the version of the eslint-plugin-react package that is installed in your project, as well as the versions of the package that are installed by any other dependencies in your project.

If you see multiple versions of the eslint-plugin-react package, you will need to update your package.json file to use the same version as the one specified in the eslint-config-react-app package.

You can do this by running the following command:

npm install eslint-plugin-react@<version> --save-dev
  • Related