What to do if webpack4 react reports errors

藏色散人
Release: 2022-12-28 09:30:09
Original
2234 people have browsed it

Webpack4 react error solution: 1. Enter the globally installed webpack directory; 2. Delete the installed webpack version; 3. Execute the command "npm un webpack npm un webpack-cli"; 4. Then Execute the "npm i webpack-dev-server@3.10.2" command.

What to do if webpack4 react reports errors

The operating environment of this tutorial: Windows 10 system, react18.0.0 version, Dell G3 computer.

What should I do if webpack4 react reports an error?

The solution to the error after upgrading webpack4 locally in the react project

What to do if webpack4 react reports errors

The error is reported as shown above:

Solution Method, enter the globally installed webpack directory:

What to do if webpack4 react reports errors

Enter the directory: first delete the installed webpack version:

Execute the following commands in sequence:

npm un webpack
npm un webpack-cli
npm un webpack-dev-server
npm i webpack@4.41.5
npm i webpack-cli
npm i webpack-dev-server@3.1.14
Copy after login

Then run the project:

There is an error as follows:

What to do if webpack4 react reports errors

The dev-server version we just installed is wrong, re-execute

npm i webpack-dev-server@3.10.2
Copy after login

Problem solved.

Recommended learning: "react video tutorial"

The above is the detailed content of What to do if webpack4 react reports errors. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template