解决常见react 启动问题 | 青训营

311 阅读1分钟

今天在预习青训营内容时发生的react错误。写下来希望能帮到大家

ERROR in Plugin "react" was conflicted between "package.json » eslint-config-react-app » C:\Users\asus\desktop\google-clone\node_modules\eslint-config-react-app\base.js" and "BaseConfig » C:\Users\asus\Desktop\google-clone\node_modules\eslint-config-react-app\base.js".

solving

Error in Plugin "react" 是非常常见的当你使用Windows 10 & VS Code & npm会遇到的问题。

网上的方法有:

  1. 打开package.json 并 (ctrl+s)。位置: \node_modules\eslint-config-react-app\package.json
    好处是简单,坏处是不方便,当你刷新页面后会重新出现这个问题,这时候你要重新打开package.json 再次 保存一遍 去取消这个error 还有一些不太靠谱的方法

我发现是因为当你使用git bash时,Because bash doesn't care about the letter case of the path. This can be fixed by changing the path of your project in bash. You must reference the exact case of the path of your project.

也就是说,把你所有路径中有大写的地方改一下,确保路径中无大写数字即可。

quick and easy.

赶紧尝试一下吧!