解决create-react-app 后 npm start 中出现 的webpack版本问题和webpack-dev-server的版本问题
利用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 就没出现问题啦
解决create-react-app 后 npm start 中出现 的webpack版本问题和webpack-dev-server的版本问题的更多相关文章
- 深入 Create React App 核心概念
本文差点难产而死.因为总结的过程中,多次怀疑本文是对官方文档的直接翻译和简单诺列:同时官方文档很全面,全范围的介绍无疑加深了写作的心智负担.但在最终的梳理中,发现走出了一条与众不同的路,于是坚持分享出 ...
- 在 .NET Core 5 中集成 Create React app
翻译自 Camilo Reyes 2021年2月22日的文章 <Integrate Create React app with .NET Core 5> [1] Camilo Reyes ...
- 如何扩展 Create React App 的 Webpack 配置
如何扩展 Create React App 的 Webpack 配置 原文地址https://zhaozhiming.github.io/blog/2018/01/08/create-react-a ...
- tap news:week5 0.0 create react app
参考https://blog.csdn.net/qtfying/article/details/78665664 先创建文件夹 安装create react app 这个脚手架(facebook官方提 ...
- 使用create react app教程
This project was bootstrapped with Create React App. Below you will find some information on how to ...
- Create React App
Facebook开源了React前端框架(MIT Licence),也同时提供了React脚手架 - create-react-app. create-react-app遵循约定优于配置(Coc)的原 ...
- Create React App 安装less 报错
执行npm run eject 暴露模块 安装 npm i less less-loader -D 1.打开 react app 的 webpack.config.js const sassRege ...
- 解决新版本webpack vue-cli生成文件没有dev.server.js问题
新版本webpack生成的dev.server.js 在webpack.dev.conf.js中 webpack.dev.conf.js const axios = require('axios') ...
- create react app 项目部署在Spring(Tomcat)项目中
网上看了许多,大多数都是nginx做成静态项目,但是这样局限性太多,与Web项目相比许多服务端想做的验证都很麻烦,于是开始了艰难的探索之路,终于在不经意间试出来了,一把辛酸... 正常的打包就不说了. ...
随机推荐
- java反射与多态(父类调用子类)的代码演示
package Test0817; import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method ...
- php八大设计模式之简介篇
设计模式的在面向对象中的重要性? 更深入的理解面向对象的思想,有利于开发出扩展性强的程序.在 PHP 面向对象中有一个 "开闭原则" :"软件实体应当对扩展开 ...
- python 异步IO
参考链接:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/00143208573 ...
- GenIcam标准(五)
2.8.10.Enumeration, EnumEntry Enumeration节点把一个名称(name)映射到一个索引值(index value),并实现Ienumeration接口.Enumer ...
- 【Codeforces Round #422 (Div. 2) A】I'm bored with life
[题目链接]:http://codeforces.com/contest/822/problem/A [题意] 让你求a!和b!的gcd min(a,b)<=12 [题解] 哪个小就输出那个数的 ...
- c++开源爬虫-Larbin简单介绍
原文地址:http://leihuang.net/2014/06/16/Larbin-Introduction/ 由于近期学校实训.做的是一个搜索相关的项目,而且是c++的一个项目.所以就想到了lar ...
- 【LeetCode-面试算法经典-Java实现】【063-Unique Paths II(唯一路径问题II)】
[063-Unique Paths II(唯一路径问题II)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Follow up for "Unique Pa ...
- Delphi的参数修饰const/var/output 与C++的对应关系
delphi的const/input和默认的没有修饰, C++都是一样的 delphi的var,对应C++那边是指针, 调用方需要管理内存(负责分配内存及销毁) delphi的output , 对应 ...
- Anatomy of an IIS7 configuration path
The concept of configuration paths is fundamental to managing and operating an IIS server, so I want ...
- Python str 与 bytes 类型(Python2/3 对 str 的处理)
本文均在 Python 3 下测试通过,python 2.x 会略有不同. 1. str/bytes >> s = '123' >> type(s) str >> ...