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.
解決方法
創(chuàng)建一個 .env 文件 SKIP_PREFLIGHT_CHECK=true 添加這句代碼泥从,在npm start就好了。