Can't read property of undefined (mix.initialize() )when use node_modules/.bin/webpack

Viewed 1783

I'm trying to compile with node_modules/.bin/webpack and I get this error:

Mix.initialize();       
   ^       
TypeError: Cannot read property 'initialize' of undefined      
at Object.<anonymous> (/home/vagrant/Code/stream/webpack.config.js:9:4)            
at Module._compile (module.js:570:32)      
at Object.Module._extensions..js (module.js:579:10)      
at Module.load (module.js:487:32)  
at tryModuleLoad (module.js:446:12)      
at Function.Module._load (module.js:438:3)       
at Module.require (module.js:497:17)      
at require (internal/module.js:20:19)      
at requireConfig 
(/home/vagrant/Code/stream/node_modules/webpack/bin/convert-argv.js:97:18)     
at /home/vagrant/Code/stream/node_modules/webpack/bin/convert-argv.js:104:17    

webpack.mix.js:

let mix = require('laravel-mix').mix;       
mix.js('resources/assets/js/app.js', 'public/js')      
.sass('resources/assets/sass/app.scss', 'public/css');    

webpack.config.js:

var path = require('path');       
var webpack = require('webpack');      
var Mix = require('laravel-mix').config;    
var plugins = require('laravel-mix').plugins;    
Mix.initialize();

I'm following this video: https://laracasts.com/series/learn-vue-2-step-by-step/episodes/26?autoplay=true

And crash at 03:29, i really appreciate any help.

3 Answers
Related