elm-language-client-vscode: elm-format fails
Expected Behavior
format file when saving or calling format action manually
Current Behavior
formating fails with
[Warn - 13:12:09] {"shortMessage":"Command failed with exit code 127: elm-format --stdin --elm-version 0.19 --yes","command":"elm-format --stdin --elm-version 0.19 --yes","exitCode":127,"stdout":"","stderr":"env: node: No such file or directory\n","failed":true,"timedOut":false,"isCanceled":false,"killed":false}
elm-format is installed globally, also tried locally and explicit path in settings - same error with different path before elm-format
Possible Solution
Steps to Reproduce (for bugs)
- Setup project like proposed in readme
- Execute Format action of vscode
Context
Your Environment
- Version used: 0.10.2
- Editor name and version (e.g. VSCode 1.36.1): VSCode 1.45.1
- Environment name and version (e.g. node.js 5.4): nodejs v14.3.0, elm 0.19.1
- Operating System and version: macOS 10.15.4
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (9 by maintainers)
Can you try to reinstall it? We recently had someone who thought it got stuck on install and aborted it and it still was callable from path.
Just setup a new machine and having the same issue.
elm-formatdoesn’t run when I save.elm-formatfrom the command lineelm.jsonin the root folderelm-tooling.jsonin the root folder.elmfiles. Same resultNot sure what else to try.
The Elm output in VS code looks fine. No mention of
elm-format, though.Hey @Razzeee I got it working!
It works when I open the folder of my project, i.e. File -> Open Folder… from VS code. Then I see Elm in the Output window drop-down.
Formatting on save didn’t work at first, but I did see a message saying “Run
npm install -g elm-format”. That didn’t work - what did was clearing the Elm Format Path setting that I had set earlier. Now it formats on save! And I have suggestions working too!Thanks for the help.
It’s on the path, and I’m able to call it manually. Which is formatting the file successfully.