npm run start后报错

使用create-react-app项目后,npm run start 报错:


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.41.5"

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\xxx\node_modules\webpack (version: 4.41.2)
(version: 3.3.1) Manually installing incompatible versions is known to cause hard-to-debug issues.
解决:全局卸载webpack后,重新安装指定版本
npm uninstall webpack
npm install webpack@4.41.5
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容