Getting error spawn java ENOENT and Emitted ‘error’ event on ChildProcess instance at: errno: -4058, code: ‘ENOENT’, syscall: ‘spawn java’,


I am trying to run the ToDoLangEditor https://github.com/amazzalel-habib/TodoLangEditor.
After running npm install antlr4ts I am getting the following errors:

npm run antlr4ts

> [email protected] antlr4ts C:UsersabcdDocumentsTodoLangEditor-master
> antlr4ts ./TodoLangGrammar.g4 -o ./src/ANTLR

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn java ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn java',
  path: 'java',
  spawnargs: [
    '-jar',
    'C:UsersabcdDocumentsTodoLangEditor-masternode_modulesantlr4ts-clitargetantlr4-typescript-4.9.0-SNAPSHOT-complete.jar',
    './TodoLangGrammar.g4',
    '-o',
    './src/ANTLR'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] antlr4ts: `antlr4ts ./TodoLangGrammar.g4 -o ./src/ANTLR`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] antlr4ts script.

How should I resolve this error?

Source: React – Stack Overflow

November 12, 2021
Category : News
Tags: antlr4 | monaco-editor | reactjs | typescript

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.