When installing fresh Laravel 8.1 with livewire when in CLI i run npm run dev i got this i m new so please help me out?
> mix
[webpack-cli] /var/www/html/Am2/node_modules/laravel-mix/src/Mix.js:18
static _primary = null;
SyntaxError: Unexpected token =
at new Script (vm.js:83:7)
at NativeCompileCache._moduleCompile (/var/www/html/Am2/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/var/www/html/Am2/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 (/var/www/html/Am2/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at module.exports (/var/www/html/Am2/node_modules/laravel-mix/setup/webpack.config.js:2:17)
Error
Go to your composer. json and in require property you will see the livewire version like: { "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "livewire/livewire": "^2.5", ... }, ...
Laravel Livewire is a library that makes it simple to build modern, reactive, dynamic interfaces using Laravel Blade as your templating language. This is a great stack to choose if you want to build an application that is dynamic and reactive but don't feel comfortable jumping into a full JavaScript framework like Vue.
Need to update node version.
Ubuntu (Linux)
Run this command to update node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
after this close current terminal and open new one and run this command in PROJECT DIR
sudo npm install
npm run dev
Just try to upgrade your current node version
Current stable 15.5.1
you can upgrade it using brew in Mac-OS case:
brew install nvm
nvm install 15
nvm use 15
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With