react脚手架运行 npm start时报错

当我们在终端输入运行命令时报错

npm strat

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

“webpack”: “4.42.0”

Don’t try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:

C:\Users\Acky\Desktop\react-test\node_modules\webpack (version: 4.43.0)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
react脚手架运行 npm start时报错_第1张图片

我们根据错误提示在 项目中创建一个 .env 的文件夹
里面的 内容写上 SKIP_PREFLIGHT_CHECK=true
react脚手架运行 npm start时报错_第2张图片
再输入命令即可

npm strat

你可能感兴趣的:(react)