'webpack-cli : Error: spawn Unknown system error -86 / Symfony

I have just acquired a new mac with M1 chip and I wonder if the error is related to this, because on my old one I have no problem.

[webpack-cli] Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:412:11)
    at spawn (node:child_process:698:9)
    at Object.execFile (node:child_process:325:17)
    at Object.module.exports.fileCommandJson (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/lib/utils.js:88:13)
    at NotificationCenter.notifyRaw (/Users/mlc/Sites/ImapImport/node_modules/node-notifier/notifiers/notificationcenter.js:81:11)
    at WebpackNotifierPlugin.compilationDone (/Users/mlc/Sites/ImapImport/node_modules/webpack-notifier/index.js:129:14)
    at Hook.eval [as callAsync] (eval at create (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/mlc/Sites/ImapImport/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:498:23
    at Compiler.emitRecords (/Users/mlc/Sites/ImapImport/node_modules/webpack/lib/Compiler.js:906:5) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

It occurs when the command is launched:

npm run dev

or

yarn encore dev

I have already tried deleting the node_modules file as well as the package-lock.json, and clearing the npm cache then re-running npm install but nothing worked.

Suggestions ?



Solution 1:[1]

Problem solved, thanks to @andreasm for pointing me in the right direction. I explain myself after checking on xcode was installed with the command :

xcode-select -p

it was, so I did not carry more attention than that, today just out of curiosity by executing :

xcode-select --install

the error has disappeared, morality: Do not trust the first command.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mlc