您的位置:首页 > 产品设计 > UI/UE

webpack报错Module build failed: TypeError: fileSystem.statSync is not a function

2018-01-29 22:38 471 查看
跟着视频操作,删掉node_modules目录后,执行webpack报错

ERROR in ./src/js/index.js
Module build failed: TypeError: fileSystem.statSync is not a function
at module.exports (/Users/mac/source/9-01/node_modules/babel-loader/lib/utils/exists.js:7:25)
at find (/Users/mac/source/9-01/node_modules/babel-loader/lib/resolve-rc.js:13:9)
at Object.module.exports (/Users/mac/source/9-01/node_modules/babel-loader/lib/index.js:113:132)百度了一下,有人说是因为webpack版本不一致导致。所以重新安装了
npm install webpack --save-dev执行这一步时出现很多警告
npm notice save webpack is being moved from dependencies to devDependencies
npm WARN babel-loader@7.1.2 requires a peer of webpack@2 || 3 but none is installed. You must install peer dependencies yourself.
npm WARN slick-carousel@1.8.1 requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN 05-01@1.0.0 No description
npm WARN 05-01@1.0.0 No repository field.
大意为 babel-loader这个版本需要更高级的webpack,于是执行下面语句安装3.0版
npm install webpack@3.0.0 --save-dev
再执行webpack就运行成功了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  webpack react