简体   繁体   English

插件“react”在“package.json » eslint-config-react-app 之间发生冲突

[英]Plugin "react" was conflicted between "package.json » eslint-config-react-app

this problem after install react安装反应后出现此问题

enter image description here在此处输入图像描述

I encountered the same error.我遇到了同样的错误。

The path u created this app is in:您创建此应用的路径位于:

\Users\TONMOY\Onedrive\feedback-ui\

The path name is case sensitive.路径名区分大小写。 You created the app in is case sensitive so you created the app in the folder ...\Onedrive\..... while the correct path in your device is ...\OneDrive\.... .您创建的应用程序区分大小写,因此您在文件夹...\Onedrive\.....中创建了应用程序,而设备中的正确路径是...\OneDrive\....

This may be an issue of VS Code.这可能是 VS Code 的问题。

The workaround to this that I found is, in the Visual Studio terminal I navigated to the correct folder path with the proper case which in your case should be我发现的解决方法是,在 Visual Studio 终端中,我使用正确的情况导航到正确的文件夹路径,在你的情况下应该是

\Users\TONMOY\OneDrive\feedback-ui\

After this running your app from the VS Code terminal should work normally.在此之后,从 VS Code 终端运行您的应用程序应该可以正常工作。 This worked for me in Visual Studio Code.这在 Visual Studio Code 中对我有用。

Update: This is just a temporary fix.更新:这只是一个临时修复。 On restarting VS Code it reverts back to the wrong case.在重新启动 VS Code 时,它会恢复到错误的情况。

Instead you could load up VS Code and browse through your system directory and select your project folder manually once.相反,您可以加载 VS Code 并手动浏览您的系统目录和 select 您的项目文件夹一次。 After doing this the path's case does not revert even after restarting.这样做之后,即使重新启动,路径的情况也不会恢复。

I went to node_modules/react-scripts/config.Acutally it's an another folder, and there is no such file as you mentioned above.我去了node_modules/react-scripts/config.Acutally它是另一个文件夹,没有你上面提到的那个文件。

Install the node modules package again.再次安装节点模块 package。 npm i npm i

This worked for me too went into the file webpack.config.js located in: node_modules > react-scripts > config and i commented all this excerpt located at the end of the file: Coment all this section这对我也有用,进入文件 webpack.config.js 位于:node_modules > react-scripts > config 我评论了位于文件末尾的所有摘录:评论所有这部分

  !disableESLintPlugin &&
        new ESLintPlugin({
          // Plugin options
          extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
          formatter: require.resolve('react-dev-utils/eslintFormatter'),
          eslintPath: require.resolve('eslint'),
          failOnError: !(isEnvDevelopment && emitErrorsAsWarnings),
          context: paths.appSrc,
          cache: true,
          cacheLocation: path.resolve(
            paths.appNodeModules,
            '.cache/.eslintcache'
          ),
          // ESLint class options
          cwd: paths.appPath,
          resolvePluginsRelativeTo: __dirname,
          baseConfig: {
            extends: [require.resolve('eslint-config-react-app/base')],
            rules: {
              ...(!hasJsxRuntime && {
                'react/react-in-jsx-scope': 'error',
              }),
            },
          },
        }),

Thank u感谢你

I got this error when returning to an old react project.返回旧的 React 项目时出现此错误。 I had to update react-scripts package.我不得不更新反应脚本 package。 Information on how to do this can be found here:可以在此处找到有关如何执行此操作的信息:

https://create-react-app.dev/docs/updating-to-new-releases/ https://create-react-app.dev/docs/updating-to-new-releases/

Well I faced the same issue and if run npm ls eslint-config-react-app to see the configration and package being used.好吧,我遇到了同样的问题,如果运行npm ls eslint-config-react-app来查看正在使用的配置和包。 Or else run npm update eslint then finally re-run npm start .或者运行npm update eslint然后最后重新运行npm start That should work as expected.这应该按预期工作。

What I did to solve this problem I went into the file webpack.config.js located in: node_modules > react-scripts > config and i commented all this excerpt located at the end of the file:我做了什么来解决这个问题,我进入了位于: node_modules > react-scripts > config的文件webpack.config.js并评论了位于文件末尾的所有摘录:

!disableESLintPlugin &&
    new ESLintPlugin({
      // Plugin options
      extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
      formatter: require.resolve('react-dev-utils/eslintFormatter'),
      eslintPath: require.resolve('eslint'),
      failOnError: !(isEnvDevelopment && emitErrorsAsWarnings),
      context: paths.appSrc,
      cache: true,
      cacheLocation: path.resolve(
        paths.appNodeModules,
        '.cache/.eslintcache'
      ),
      // ESLint class options
      cwd: paths.appPath,
      resolvePluginsRelativeTo: __dirname,
      baseConfig: {
        extends: [require.resolve('eslint-config-react-app/base')],
        rules: {
          ...(!hasJsxRuntime && {
            'react/react-in-jsx-scope': 'error',
          }),
        },
      },
    }),

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 插件“react”中的错误在“package.json » eslint-config-react-app 之间发生冲突 - ERROR in Plugin "react" was conflicted between "package.json » eslint-config-react-app 部署 React 应用程序时出错,它一直在说 &lt;&lt; Plugin "react" was conflicted between "package.json » eslint-config-react-app » &gt;&gt; - Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >> 无法加载在“package.json » eslint-config-react-app”中声明的插件“import”:找不到模块“typescript/package.json” - Failed to load plugin 'import' declared in 'package.json » eslint-config-react-app': Cannot find module 'typescript/package.json' 无法加载在“package.json » eslint-config-react-app”中声明的插件“jsx-a11y”:意外的令牌 = - Failed to load plugin 'jsx-a11y' declared in 'package.json » eslint-config-react-app': Unexpected token = 无法加载在“package.json » eslint-config-react-app/jest”中声明的插件“jest”:无法读取未定义的属性(读取“meta”) - Failed to load plugin 'jest' declared in 'package.json » eslint-config-react-app/jest': Cannot read properties of undefined (reading 'meta') 插件“react”在“package.json”之间发生冲突 - Plugin "react" was conflicted between "package.json 无法加载在“package.json » eslint-config-react-app”中声明的插件“flowtype”:找不到模块“eslint/use-at-your-own-risk” - Failed to load plugin 'flowtype' declared in 'package.json » eslint-config-react-app': Cannot find module 'eslint/use-at-your-own-risk' 如何解决这个错误:package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown - How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown Eslint 插件“反应”在 eslintrc.json >> eslint-config-airbnb 之间发生冲突 - Eslint Plugin "react"was conflicted between .eslintrc.json >> eslint-config-airbnb ESLint:插件“反应”在两者之间发生冲突 - ESLint: Plugin "react" was conflicted between
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM