humio/atom-elm-format

exited with code 127

Closed this issue · 15 comments

m0nq commented

Have had to repoint the module to the node install of elm-format. Still getting exit code 127.

m0nq commented

Ugh... apologies. Figured it out.

@m0nq Any chance you could post your solution? I'm having the same 'code 127' issue.

Can you run elm-format from your terminal?

Yeah, that works fine.

Can you show me the output? What os? How do you launch atom?

The output of elm-format CLI or..?

I'm on Linux Mint and usually launch Atom from my terminal (atom .)

Thanks for the super fast response ✨

If you did mean the terminal output then it's:

elm-format-0.18 0.6.1-alpha

Usage: elm-format [INPUT] [--output FILE] [--yes] [--validate] [--stdin]
[--elm-version VERSION] [--upgrade]
Format Elm source files.

Available options:
-h,--help Show this help text
--output FILE Write output to FILE instead of overwriting the given
source file.
--yes Reply 'yes' to all automated prompts.
--validate Check if files are formatted without changing them.
--stdin Read from stdin, output to stdout.
--elm-version VERSION The Elm version of the source files being formatted.
Valid values: 0.16, 0.17, 0.18. Default: 0.18
--upgrade Upgrade older Elm files to Elm 0.18 syntax

Examples:
elm-format Main.elm # formats Main.elm
elm-format Main.elm --output Main2.elm # formats Main.elm as Main2.elm
elm-format src/ # format all *.elm files in the src directory

Full guide to using elm-format at https://github.com/avh4/elm-format

Okay so either rename the binary "elm-format" or change the binary path in the extension settings (recommended) to the same name as the binary you run from the terminal. Let me know how it goes!

When the path to the binary is (hopefully) correct I get 'elm-format exited with code 127.'

If I change it to an incorrect path I get 'Can't find elm-format binary, check your settings'.

Can you give me the output of "ls -la elm-format"? Replace elm-format with your real filename

lrwxrwxrwx 1 finn finn 45 Jun 5 16:59 /home/finn/.nvm/versions/node/v6.10.3/bin/elm-format -> ../lib/node_modules/elm-format/bin/elm-format

Ummm so it seems to be working now...
I think it was a problem with the elm file I was using rather than your side 😳
My bad!
Thanks so much for your help.

Interesting. Would it be possible to get the file so I can test with it?

At the start I was running elm-format on a simple .elm file but had the binary linked incorrectly. Then I started the Front End Masters Elm video series, fixed the binary, but didn't realise elm-format wouldn't work correctly on the new file... Sorry, new to Elm.

The files that got code 127 are in this repo: https://github.com/rtfeldman/elm-workshop/

I think I tested elm-format on parts 4-6. Guessing there's a bad version of something somewhere 🤷‍♂️