本文介绍了Laravel 8使用livewire npm install& amp;的全新安装npm运行开发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CLI中使用livewire安装新的Laravel 8.1时,我运行npm run dev我得到了这个新消息,所以请帮帮我吗?

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)

错误

推荐答案

需要更新节点版本.

运行此命令以更新节点

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

在关闭当前终端并打开新终端后,在 PROJECT DIR

after this close current terminal and open new one and run this command in PROJECT DIR

sudo npm install
npm run dev

这篇关于Laravel 8使用livewire npm install& amp;的全新安装npm运行开发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:47