humio/atom-elm-format

Default elm-format binary path is not suitable for Windows

Closed this issue ยท 8 comments

avh4 commented

The default appears to be /usr/local/bin/elm-format, which is okay for mac/linux. But on Windows, I think the default should probably just be elm-format so that it will be found if it's on the PATH.

Also, the error message when this happens is misleading: it says "elm-format exited with code 1", but actually elm-format was not found at all.

I have a solution for this, but I need to find a Windows box to test it.

@emandres what do you put in your binary path for elm-format?

I have a ~\bin folder in my home directory that is on my PATH. That's where I put the elm-format.exe file.

avh4 commented

I use vagrant init opentable/win-2012r2-standard-amd64-nocm && vagrant up for windows testing

Same problem. I use win7

For anyone with this question, and my future self: I fixed this by inputting the exact path to the elm-format.exe. In my case it is: C:/Program Files (x86)/Elm Platform/0.18/bin/elm-format.exe

Works perfect after doing this!

Thanks @Eeveline! ... I gave the platform install a try and this worked (as opposed to npm) for others I had to get the elm-format from https://github.com/avh4/elm-format/releases/ and copy it into the platform bin.

@Eeveline 's comment helped me here ( thank you ๐Ÿ˜„ ) - but if that doesn't work make sure you got all this steps right.
valid for windows people still struggling with this:
๐Ÿ‘‰ step1: apm install elm-format
๐Ÿ‘‰ step2: then make sure you have Elm Platform installed from here.
๐Ÿ‘‰ step3: make sure you unzipped the elm-format executable from here - and place it inside the same folder as the Elm Platform installation - you can see it in the path below.
๐Ÿ‘‰ step4: include C:/Program Files (x86)/Elm Platform/0.18/bin/elm-format.exe path in the box of elm-format package - inside the Atom UI - Settings tab as you can see below.

atom error elm-format exited with code null - how to fix this error in windows 10