webpack4 Cannot find module '@babel/core'
Error:
// webpack
Cannot find module '@babel/core'
解决办法一:
原因"babel-loader": "^8.0.0" 版本问题。
使用"babel-loader": "^7.1.5"即可解决该错误。
package.json
{
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5"
}
}
解决办法二:
安装@babel/core依赖
https://www.npmjs.com/package/@babel/core
npm install --save-dev @babel/core
参考:https://blog.csdn.net/zSY_snake/article/details/88036785
https://www.cnblogs.com/jiebba/p/9618930.html