删除node-modles包,然后修改package.json文件:再npm i 就行~
It'll work fine if downgrade the version
"babel-core": "^6.26.0"
"babel-loader": "^7.1.4"
"babel-preset-env": "^1.6.1"
{"name":"webpack-4-tutorial","version":"1.0.0","description":"","main":"index.js","scripts":{"dev":"webpack --mode development","build":"webpack --mode production"},"keywords":[],"author":"","license":"ISC","devDependencies":{"babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-preset-env":"^1.6.1","webpack":"^4.17.1","webpack-cli":"^3.1.0"}}