Open JesterXL opened 5 years ago
It appears like there never actually was an errorMsg
function in messages.js
. The import appears in commit 8339d43 seemingly derived from the field of an object.
I experienced the crash from the attempted call to errorMsg
when I got this error from mixing up my argument order (causing elm-live to attempt to use my source code as the elm binary):
Error: spawn src/Main.elm EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'EACCES',
code: 'EACCES',
syscall: 'spawn src/Main.elm',
path: 'src/Main.elm',
spawnargs: [ 'make', '--report=json', '--output=src/elm.js' ]
}
It also seems like the errno
or code
field on error should be checked instead of name
(which in my case seems to have the value "Error") because your error definitely should have been caught by the true part of the if statement.
I ran into a similar problem trying to start elm-live (and elm) installed on local node_modules directory.
I also agree that the errno
or code
field on error could be checked for "ENOENT" and "EACCES".
I attempted to run ./node_modules/.bin/elm-live
using WSL1 Bash on Windows.
Inspecting error
object in proc.on('error')
callback inside build.js:
Error: spawn elm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
[stack]: 'Error: spawn elm ENOENT\n' +
' at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)\n' +
' at onErrorNT (internal/child_process.js:456:16)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:80:21)',
[message]: 'spawn elm ENOENT',
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn elm',
path: 'elm',
spawnargs: [ 'make', '--report=json', [length]: 2 ]
}
Crazy edge case I know, but causes a null pointer. I'm setting up a new Mac and forgot to install Elm, lol... so that means
elm-live
is like "waaaat...".Line 99 of build.js:
Apparently
errorMsg
doesn't actually exist inmessages.js
. Anyway, the error looks like this:There might be a way to parse that and go "Are you sure Elm is actually installed or in your $PATH?" or something like that. Also, not sure what
errorMsg
is supposed to do.