"无法读取属性' mergeConfig'未定义"安装VueJS时出错

时间:2016-09-30 06:07:33

标签: php laravel-5 gulp vue.js

在Laravel Project中运行Gulp时安装VueJS,我得到以下信息:

Me-MBP:simpleb2b AdnanAhmad$ gulp build
/Applications/MAMP/htdocs//myProject//node_modules/laravel-elixir-vue/main.js:4
    Elixir.webpack.mergeConfig({
                  ^

TypeError: Cannot read property 'mergeConfig' of undefined
    at /Applications/MAMP/htdocs//myProject/node_modules/laravel-elixir-vue/main.js:4:19
    at /Applications/MAMP/htdocs//myProject//node_modules/laravel-elixir/dist/index.js:29:16
    at Array.forEach (native)
    at global.Elixir (/Applications/MAMP/htdocs//myProject//node_modules/laravel-elixir/dist/index.js:28:24)
    at Object.<anonymous> (/Applications/MAMP/htdocs//myProject//gulpfile.js:16:1)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

2 个答案:

答案 0 :(得分:0)

此问题通过运行npm install并使用git-bash cmd运行gulp来解决我的问题。 注意:请确保按照建议的here

全局安装gulp

答案 1 :(得分:0)

删除和重建\node_modules并没有为我改变任何内容。

尝试

npm install --save laravel-elixir-webpack-official

此后应该有效。