利用VSCode搭建react的脚手架运行环境的时候。create-react-app之后npm 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.19.1" 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\17720\node_modules\webpack (version: 4.25.1)
(version: 2.9.1) Manually installing incompatible versions is known to cause hard-to-debug issues.

在参考 https://blog.csdn.net/muzi190/article/details/84108714 之后,又出现如下的问题。。。:

PS C:\Users\17720\Desktop\Study\React\hello> npm start

> hello@0.1.0 start C:\Users\17720\Desktop\Study\React\hello
> react-scripts 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-dev-server": "3.1.14" Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack-dev-server was detected higher up in the tree: C:\Users\17720\node_modules\webpack-dev-server (version: 2.9.1) Manually installing incompatible versions is known to cause hard-to-debug issues.

解决办法:找到版本出问题的目录:如我的是

C:\Users\17720\node_modules\

然后在该路径(这是全局路径)下卸载不符合版本的webpack 与 webpack-dev-server

注意卸载webpack时还需要卸载webpack-cli ,4.0版本后的webpack都带有webpack-cli:

npm un webpack
npm un webpack-cli
npm un webpack-dev-server

然后再把提示报错的版本安装上,如:

npm i webpack@4.19.1
npm i webpack-cli
npm i webpack-dev-server@3.1.14

这时候再次npm start 就没出现问题啦

最新文章

  1. Servlet-Cookie源码分析 源码环境:Tomcat8
  2. 一、MMA概述
  3. 一个div,包含三个小的div,平均分布的样式
  4. 使用fiddler手机抓包
  5. Interleaving String leetcode
  6. ubuntu忘记登录账户以及密码
  7. Scala学习笔记--正则表达式基础知识、如何在scala内使用
  8. 自动添加注释—VS2010宏的使用
  9. MyEclipse构建Web Service(Xfire框架)
  10. 计算两个date类型的时间差
  11. SQL语句将一个表的数据写入到另一个表中
  12. swagger.core的使用方法
  13. 从 RAID 到 Hadoop Hdfs 『大数据存储的进化史』
  14. 蓝牙Bluetooth技术手册规范下载【转】
  15. 2017 33 款iOS开源库
  16. gitblit系列七:使用Jenkins配置自动化持续集成构建
  17. mysql中设置默认字符编码为utf-8
  18. ubuntu15.04中安装mysql和mysql-workbench
  19. 【bzoj3362-导航难题】带权并查集
  20. not found command:svn

热门文章

  1. nil gogo
  2. caffe(4) 激活层(Activation Layers)及参数
  3. oracle 12c 关于wm_concat 的替换;LISTAGG
  4. 移动端 Modal 组件开发杂谈
  5. eclipse 启动报错has value '1.7', but '1.8' is required
  6. 洛谷—— P1969 积木大赛
  7. C++模板中重要的术语
  8. ORA-01003: no statement parsed
  9. Windows安装两个mysql数据库步骤
  10. mysql日期函数及批量循环返回主键ID