New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't find the elm-format binary, check the "elm-format" package settings page #408
Comments
Same error. Windows 10. Atom 1.20.1 x64. |
Same here on Windows 10, VS Code 1.16.
Feeding it the full path to executable does not help. |
I had to use Windows 10 |
Same error for me on Mac OS 10.12.4, Atom 1.21.2 |
Ditto OSX 10.13.1, Atom 1.22.0-beta0 |
Did anyone happen to find a concrete solution to this problem? |
The workaround is to first verify that you can run elm-format from the terminal, and if that works, then provide the full, absolute path to elm-format in the settings for the Atom elm-format plugin. If people can also provide information to me about the following, then I can help improve the guidelines for elm-format plugin authors to help make sure that the path can be detected automatically in more cases:
Thanks! |
@avh4 Providing the full path worked for me within the atom package, thanks for the help! By the way, I installed using npm global installation, navigated to the .exe, and pasted that path into the atom package config. |
#1 Install $ npm install -g elm-format #2 Install $ apm install elm-format or from the Atom GUI, where File -> Settings -> Install and search for #3 Download the zipped version [it has only elm-format.exe inside]. Unzip it and place it on your How to find the
|
I had the same error and indeed I think when people read the instructions and see |
I started getting this after upgrading elm-format From Installed with Using VSCode 1.27.2 Using VSCode Elm extension v0.21.0 (released 2018-08-30) It is in my PATH I've played around with many potential settings for Downgrading back to (Unfortunately, 0.8.1 has a bugfix I need.) Edit: The VSCode extension knows about this problem and has a fix planned, but not quite released: https://github.com/Krzysztof-Cieslak/vscode-elm/issues/270 But the workaround there worked for me, and now I'm happily using 0.8.1-rc2. So my problem may have been different from others' here. |
I have the same issue feluxe originally outlined. I have elm-format accessible from the command line but the editor plugins fail to find the elm-format executable. I have tried this with VS Code and the elm plugin (linked to from the install directions). I have tried this with Atom and both the elm-format and the atom-beautify plugins (linked to from the install directions). Windows: 7 Elm: 0.19.0 I have tried installing elm through npm, yarn, and the msi installation wizard. I have tried installing elm-format with npm and via downloading the executable. Nothing has fixed the editor plugins problem. |
@DylanLester have you tried |
@absynce I have tried the following using VS Code (restarting after each change): Just the command
Absolute paths to npm install
Navigating to the folder C:\Users\Dylan\AppData\Roaming\npm and running Interesting though, if I run the file with an Elm syntax error I get this message: |
I cloned the VS Code plugin and ran the extension in debug mode. The plugin runs
The actual error object received from the
I googled the error message: "Error: Command failed child_process" and found this GitHub issue: nodejs/node-v0.x-archive#4590. The last user in that thread suggests this is displaying false errors. When I view the This is the unformatted Elm code: Here is the The same module Main exposing (Model, init)
type alias Model =
Int
init : Model
init =
0 I'm not really sure what to do with that. |
Nice find @DylanLester . I have had the same issue with Windows 7, VS Code 1.30.2, ELM 0.19. Tried variants of the "elm.formatCommand" using absolute paths and commands, and checked my PATH and tried setting editor.formatOnSaveTimeout to 1500, and 3000 to no avail. So assuming the issue is with the Node false error I did a little more digging and settled on a clunky workaround, which is to alter this line https://github.com/Krzysztof-Cieslak/vscode-elm/blob/master/src/elmUtils.ts#L98 to And also https://github.com/Krzysztof-Cieslak/vscode-elm/blob/master/src/elmUtils.ts#L118-L120 to These just ignore this specific error, and doesn't solve the underlying issue and I'm sure this is bad form and will come back to bite me, but posting in case this helps someone else not have to run elm-format in their build scripts like I've been doing, and can now get the benefit of using elm-format in the editor as intended :-) |
After trying all of the above, what finally worked for me (in VS Code) was symlinking elm-format binary |
I am working on MacOSX, Vscode. |
Maybe related to this issue reported for the vscode Elm extension? |
I tried various things with inconsistent results until I realized that in some cases I'd come back to the file minutes later and it would be formatted all of the sudden. Based on some other recommendations for configuration on Windows specifically I ended up with the following workspace settings for VSCode. {
"elm.compiler": ".\\node_modules\\.bin\\elm",
"elm.makeCommand": ".\\node_modules\\.bin\\elm make",
"elm.formatCommand": ".\\node_modules\\.bin\\elm-format",
"[elm]": {
"editor.formatOnSave": true,
"editor.formatOnSaveTimeout": 20000
},
} Notice the Windows specific path separators used as well as the 20 second timeout value. At least on my local machine it appears that elm-format is taking around 13 seconds to process a somewhat largish file (2181 lines). |
I confirm the issue, and that The funny thing, is that I got the error after a couple of days using the |
Actually it doesn't work anymore :/, and now returns
|
On my new operating system Guix I'm installing everything locally ( |
Exit code 127 means the executable is not found. So that sounds like a problem with the PATH. Though it's weird that it's the same error if you give the editor setting an absolute path to elm-format. Maybe |
Ah! Yes, I'm not trying to have anything node-related on my global PATH (would relative entries be okay?) because I have node set up on a per-project (this folder only) development environment. |
@Erudition in that case, you might want to use elm-tooling, which itself still uses node, but it will download the elm-format binary for you and put it in your project's node_modules and the result will not have a nodejs wrapper around elm-format, so your editor won't need node on the PATH to run elm-format. |
@avh4 you're the best! That worked like a charm. Can I get rid of the absolute path in the settings then? Have it just use the current project's |
The recommendation to plugin authors is that it should check |
thanks. for the atom plugin, it seems the answer is currently no. setting it to blank means it does not find it at all, even though it exists where you describe. So I guess I can't use a per-project path right now. Had to use the elm-tooling user-wide path, |
Hi there!
I just installed elm-format like this:
on my Linux Mint machine.
I can now access the
elm-format
tool on my command line.I ran this to install the elm-format atom plugin:
Now if I save an elm file in Atom I get this error:
The text was updated successfully, but these errors were encountered: