Webpack error when trying to run laravel-mix watch

24 views Asked by At

I have the latest version of the laravel-mix, webpack as well as the rest of the dependencies in my project. Im using Mac M3 chip as my local machin and when I try to run "npm run watch", "dev" or "prod" I get the following error. Any idea why and how to fix it? So far I tried installing the node through NVM, "softwareupdate --install-rosetta" a trying different version of the "webpack-notifier" and none of them is working.

[webpack-cli] Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:761:9)
    at Object.execFile (node:child_process:351:17)
    at module.exports.fileCommandJson (/node_modules/webpack-notifier/node_modules/node-notifier/lib/utils.js:88:13)
    at NotificationCenter.notifyRaw (/node_modules/webpack-notifier/node_modules/node-notifier/notifiers/notificationcenter.js:81:11)
    at WebpackNotifierPlugin.compilationDone (/node_modules/webpack-notifier/index.js:129:14)
    at _next1 (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:39:1)
    at eval (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:63:1) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}
1

There are 1 answers

0
Jay On

This can be bypassed by adding .disableNotifications() to the webpack.mix.js file. For example:

const mix = require("laravel-mix");
mix.js("directory/javascript.js", "public/js").disableNotifications();

This is not a solution but will eliminate the error.