My initial npm run dev (or watch or production) after a clean install of Laravel is being prematurely interrupted by a SyntaxError: Unexpected token = error message:
$ npm run dev #@ watch /home/{...}/www-teste mix watch [webpack-cli] /home/{...}/www-teste/node_modules/laravel-mix/src/Mix.js:18 static _primary = null; ^ SyntaxError: Unexpected token = at new Script (vm.js:83:7) at NativeCompileCache._moduleCompile (/home/{...}/www-teste/node_modules/v8-compile- cache/v8-compile-cache.js:240:18) at Module._compile (/home/{...}/www-teste/node_modules/v8-compile-cache/v8-compile- cache.js:184:36) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (/home/{...}/www-teste/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at module.exports (/home/{...}/www-teste/node_modules/laravel-mix/setup/webpack.config.js:2:17)
Steps To Reproduce:
- laravel new www-teste (with or without --dev)
- cd www-teste
- npm install
- npm run {dev|watch|production}
Software versions:
- Laravel Mix Version: 6.0.10 (npm list --depth=0)
- Node Version (node -v): 6.0.10
- NPM Version (npm -v): 6.0.10
- OS: Ubuntu 20.04.1 LTS
How can I install a clean version of Laravel and enable Laravel-mix?