Laravel 8全新安装,带livewire npm安装和维护&;npm运行开发错误

Laravel 8全新安装,带livewire npm安装和维护&;npm运行开发错误,laravel,Laravel,当使用livewire安装fresh Laravel 8.1时,当我在CLI中运行npm run dev时,我得到了这个我是新的,所以请帮助我 > 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 NativeCompi

当使用livewire安装fresh Laravel 8.1时,当我在CLI中运行npm run dev时,我得到了这个我是新的,所以请帮助我

> 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)

错误

请尝试升级当前节点版本

15.5.1

您可以在Mac OS情况下使用brew进行升级:


需要更新节点版本。

Ubuntu(Linux)

运行此命令以更新节点

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
在此之后,关闭当前终端并打开新终端,然后在项目目录中运行此命令

sudo npm install 
npm run dev

谢谢你修复了我的问题我有节点15.12但还是相同的错误?你知道可能是什么问题吗?非常感谢@Parth。这对我很有效,这个解决方案很有魅力。向上投票
sudo npm install 
npm run dev