– configuration.output.path:提供的值“public”不是绝对path! 与Webpack

我正在使用基于WebPack的Laravel Mix。

我有它的工作,现在,它失败:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.output.path: The provided value "public" is not an absolute path! 

如果我删除了我的webpack.mix.js内容,它仍然以相同的方式失败。

你能帮我debugging这个错误,我不知道如何前进。

我已经删除了node_modules文件夹,并运行npm install ,但仍然失败。

任何想法我应该如何解决这个问题?

使用__dirname

例如

 output: { path: __dirname + "/dist/js", // or path: path.join(__dirname, "dist/js"), filename: "bundle.js" } 

获取:错误:`output.path`需要是绝对path或`/`

将webpacklocking在composer.json中的2.2.1

 "devDependencies": { ... "webpack": "2.2.1", "laravel-mix": "^0.8.1", ... } 

如这里所引用的:

https://github.com/JeffreyWay/laravel-mix/issues/595

引用此评论 :

对于其他人想知道如何利用这个修补程序,你可以编辑你的package.json并确保你的larave-mix版本是0.10或更高:

"laravel-mix": "^0.10.0",

然后运行npm更新。

我认为最好的(最干净的)解决scheme是将Laravel Mix更新到最新版本(今天为0.12)

它似乎是一个Laravel混合与Webpack 2.3.0不兼容 – > https://github.com/JeffreyWay/laravel-mix/issues/595