webpack - laravel mix 编译出错,怎么解决呢?
PHP中文网
PHP中文网 2017-07-03 11:42:33
0
2
1339
in ./resources/assets/js/app.js

Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home/insua/sites"
    at /home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/home/insua/sites/laravel/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/home/insua/sites/laravel/node_modules/babel-loader/lib/index.js:46:20)
    at /home/insua/sites/laravel/node_modules/babel-loader/lib/fs-cache.js:79:18
    at ReadFileContext.callback (/home/insua/sites/laravel/node_modules/babel-loader/lib/fs-cache.js:15:14)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:366:13)

我是直接用

composer create-project laravel/laravel laravel --prefer-dist

安装的laravel最新版本,yarn安装npm依赖,然后npm run dev
没有修改laravel的任何文件,结果报错,找不到es2015这是咋回事呢

PHP中文网
PHP中文网

认证高级PHP讲师

全部回复(2)
伊谢尔伦

npm install babel-preset-es2015 -g

Ty80
  1. 升级 node npm 到新版

  2. 删除 node_modules 重新 yarn 安装

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板