Elm-format: Cannot install elm-format Atom Package

Created on 2 Jul 2016  路  17Comments  路  Source: avh4/elm-format

I have installed elm-format for Atom by doing the following:

$ apm install elm-format

However, which elm-format doesn't generate a Unix path. Thus, are there additional instructions for getting this installed? Where should the binary application (i.e. elm-format) reside?

question

Most helpful comment

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

All 17 comments

It should be on your $PATH, which will commonly be /usr/local/bin/. Another recommendation is to put it in the same folder that elm-make is in.

https://github.com/avh4/elm-format#installation-

Updates to the elm-format README are welcome if you can help make it more clear.

@avh4 This executable isn't being installed after execution of the command, apm install elm-format. Thus, I'll try one of the pre-built binary distributions.

Ah, yes, elm-format has to be installed first. I've updated the README today to add that step for all editor plugins: https://github.com/avh4/elm-format#atom-elm-format-installation

Sorry I still do not understand. everything worked nicely before 0.17 now I keep getting errors. Tried a lot of things re-installing atom, beautify, elm-format etc.
Error Could not find 'elm-format'. The program may not be installed.

Ah, okay. You mentioned before that which elm-format doesn't give you a path. Is that still the case? If so, you'll need to download elm-format again, unzip it and put it in /usr/local/bin/

there is no apm install atom-elm-format
failed Request for package information failed: Not found

I'm on Win10, I do not have a /usr/local/bin to put elm-format

and there is no executable? What should Beautify find even when it was in my path?

Sorry all instructions are rather confusing.

The apm command should be: apm install elm-format (I've corrected the README.)

When you download elm-format from https://github.com/avh4/elm-format/blob/master/README.md#installation-
you should unzip the zip file and have elm-format.exe. I would suggest putting it in whatever folder elm.exe and elm-make.exe are in on your computer.

That makes a lot of sense, sorry I should have figured that out myself.

One more question, it now gives a red elm-format exited with code 1 when I save an elm file, I think something must be wrong with my atom core packages maybe?

I believe that means either that the plugin didn't find elm-format, or that elm-format couldn't parse your file.

Were you able to run elm-format from the terminal? You mentioned you're on Windows, so you'll probably have to put the full path to elm-format.exe in the settings page for the elm-format atom plugin.

If that looks like it's set correctly, you could try formatting a file containing just the following to check that it's working:

foo = ()

@avh4 I have a variation on the same issue. In Atom I can do Ctrl+Alt+B and get formatting, but when I save (Ctrl+S) I get an error elm-format exited with code null. (I also got a similar error in OSX). I think I have the correct plugins and which elm-format is working. What's happening?

image

can you try going to the settings for the elm-format plugin and setting the elm format path to whatever which elm-format gives you?

thanks - seems to have helped

I just found out that if I have an error in the code, the elm-format "exits with code 1"

I tried compiling the code without the pretty formatting, and that's when the elm compiler pointed out the specific error.
Once that got fixed, elm-format worked without flaw.

Maybe this is helpful info?

I confirm explicitly specifing elm-format package settings in atom editor solves the issue.
(setting: binary path -> path for elm-format).
elm-format exited with code null error message disappears,
then elm-format exited with code 1 appears only as long as there are syntax errors, which is perfectly correct.

Sorry. Been following all the advice, and still can't seem to get it installed properly. :/
Every time I try to install it (both in the command line and in atom package manager) then ask 'which elm-format' it doesn't return anything.

*UPDATE: was able to successfully install and use it through npm

*UPDATE: was able to successfully install and use it through npm

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rtfeldman picture rtfeldman  路  4Comments

amitaibu picture amitaibu  路  6Comments

yonigibbs picture yonigibbs  路  7Comments

Janiczek picture Janiczek  路  5Comments

avh4 picture avh4  路  5Comments