prettier-vscode
prettier-vscode copied to clipboard
Prettier error spawnSync EINVAL when formatting Apex classes
When attempting to format Apex code using prettier-plugin-apex, receiving a spawn EINVAL error. The error occurs during the child process spawning phase.
Error: spawn EINVAL
at ChildProcess.spawn (node:internal/child_process:420:11)
at Object.spawn (node:child_process:777:9)
at file: node_modules/prettier-plugin-apex/dist/src/parser.js:12:38
at new Promise (
Solution: /node_modules/prettier-plugin-apex/dist/src/parser.js const process = childProcess.spawn(executable, args); ===> const process = childProcess.spawn(executable, args, { shell: true });