0

I'm using Laravel 8; my error is the following.

[webpack-cli] D:\appdownloads\www\laravel_8\chaythu1\node_modules\laravel-mix\src\Mix.js:18
    static _primary = null;
                    ^

SyntaxError: Unexpected token =
    at new Script (vm.js:83:7)
    at NativeCompileCache._moduleCompile (D:\appdownloads\www\laravel_8\chaythu1\node_modules\v8-compile-cache\v8-compile-cache.js:240:18)
    at Module._compile (D:\appdownloads\www\laravel_8\chaythu1\node_modules\v8-compile-cache\v8-compile-cache.js:184:36)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787: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:690:17)
    at require (D:\appdownloads\www\laravel_8\chaythu1\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at module.exports (D:\appdownloads\www\laravel_8\chaythu1\node_modules\laravel-mix\setup\webpack.config.js:2:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `mix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Hieu\AppData\Roaming\npm-cache\_logs\2021-01-14T02_56_14_187Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Hieu\AppData\Roaming\npm-cache\_logs\2021-01-14T02_56_14_261Z-debug.log
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
  • 1
    Have you taken a look at this https://stackoverflow.com/questions/65653570/laravel-8-fresh-installation-with-livewire-npm-install-npm-run-dev-error? – Chukwuemeka Inya Jan 14 '21 at 03:43

1 Answers1

1

First, check your node version using node -v. I guess your current node version isn't the latest version. So upgrade your node and then use npm install and npm run dev will solve your problem.

You are using windows so if you have no idea about how to upgrade let's check How to upgrade node.js on Windows?

Senthurkumaran
  • 1,738
  • 2
  • 19
  • 29