react 项目 npm run start 报错
There might be a problem with the project dependency tree.
It is likelynota bug in Create React App, but something you need to fix locally.
Thereact-scriptspackage provided by Create React App requires a dependency:
"webpack": "4.41.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version ofwebpackwas detected higher up in the tree:
/Users/macbook/node_modules/webpack (version: 4.40.2)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, addSKIP_PREFLIGHT_CHECK=trueto an.envfile in your project.
That will permanently disable this message but you might encounter other issues.
解决方法
创建一个 .env 文件 SKIP_PREFLIGHT_CHECK=true 添加这句代码,在npm start就好了。