atom-elixir-formatter
atom-elixir-formatter copied to clipboard
Getting Elixir Fomatter Error
When I am saving a file (for Phoenix / Elixir), I get an Error:
Elixir Formatter Error
Error: spawnSync mix ENOENT
And it is not formatting the code.
I recently upgraded to Mac os version 10.15.7. Is there anything else about my environment I can tell you to try to track this down
Sorry for the slow reply. Could you post the full stack trace? I've never seen this issue before and it will help isolate the problem. Thanks
Can you point me to how I can do that?
Errors get logged to the Atom console, which you can view it by clicking on View > Developer > Toggle Developer Tools
.
Is this helpful? This is a deprecation.
stacktrace/styles/stacktrace.lessfile:///Users/arnimikelsons/.atom/packages/stacktrace/styles/stacktrace.less · Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors: o .stacktrace .frame atom-text-editor::shadow .scroll-view => .stacktrace .frame atom-text-editor.editor .scroll-view Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.
When I save, nothing shows up in the console.
Arni
From: Ron Green [email protected] Reply-To: rgreenjr/atom-elixir-formatter [email protected] Date: Wednesday, October 14, 2020 at 5:17 PM To: rgreenjr/atom-elixir-formatter [email protected] Cc: Arni Mikelsons [email protected], Author [email protected] Subject: Re: [rgreenjr/atom-elixir-formatter] Getting Elixir Fomatter Error (#29)
Errors get logged to the Atom console, which you can view it by clicking on View > Developer > Toggle Developer Tools.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/rgreenjr/atom-elixir-formatter/issues/29#issuecomment-708665171, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADWVJ5TPOFA2C3CNBGDBMLSKYIO3ANCNFSM4RTOEOGQ.
Hi @arnimikelsons – It appears the formatter is having trouble running the Elixir mix
build tool. Please try reinstalling Elixir and verifying that you can successfully run the mix
command manually from a terminal. That will hopefully resolve the issue.
I am able to run mix successfully in a terminal (all the time, actually). Would it be that the path is wrong?
which mix
returns /usr/local/bin/mix
Is there a place that can be set?
Yes, take a look a the project documentation – it shows how you can specify the absolute path of your elixir
executable. Hopefully, this will resolve the issue.
Long time in responding. Unfortunately not.
which mix
returns /usr/local/bin/elixir
I put that in the Settings, and then I get an error:
/usr/local/bin/elixir: line 230: exec: erl: not found
Thanks, that's helpful. The error means it's not finding the path to your erlang installation. You'll need to make sure erlang is in your path.
arnimikelsons% which erl /usr/local/bin/erl
is that not correct?
Yeah, that looks correct. This is unusual and I'm not sure what's going on, but the erl: not found
error indicates that it's not being found on your path when run outside of your shell.
I'm not sure why it's not seeing your PATH environment values, but I'd recommend downloading and re-installing the latest version of Atom. It's probably the easiest next step to rule out that issue.
downloaded and resinstalled Atom. Also upgraded Elixir, and it is the same.
I ran into this using asdf to manage Elixir/Erlang on Ubuntu 20.10 and I was able to fix it by verifying a global version was set for both and then restarting atom.
Also ran into this running Atom 1.58.0 on macOS 12.2. It may be a bug in Atom; the PATH in process.env["PATH"]
doesn't have the default PATHs I've set in my shells unless it was started from a shell. The work-around is to always start atom from your shell.