react+typescript 项目 npm run start 报错

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就好了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容