Install Elm - how

[Sorry, could not find a recent post on this subject.]

What would be the advised way to install Elm on a machine (apple silicon in my case). Think the options i have are brew, npm and the installer from elm-lang.org.

Brew is always a solid option for Mac. If youā€™re using npm for other parts of your project the Iā€™d recommend @lydell/elm for now as it provides the Apple silicon version.

Nix, if you or others are interested, is also a solid solution.

2 Likes

elm-tooling-cli would be a good approach on any platform. Thereā€™s also a comparison with the elm and @lydell/elm npm packages in the FAQ page.

2 Likes

Also, if youā€™re just getting started with Elm it doesnā€™t really matter how you install it. You can always change later. Itā€™s not like with Python and Haskell where you can ā€œmess upā€ your installation.

One thing to note is that if you use the official installer or the official npm package, you need Rosetta to run them. While brew, @lydell/elm and elm-tooling as mentioned by others have native M1/M2 binaries.

2 Likes

I install everything I can using nix these days. Download Nix / NixOS | Nix & NixOS
The Elm binary for ARM is available there.

1 Like

Hi all!

Forgive me in my infinite ignorance as I am a complete elm newbie. Iā€™ve just moved to my new machine (M1 Mac) and proving harder than I expected to get setup for Elm dev!

Iā€™ve tried my best to follow the instructions at the Elm tools page. Can anyone explain whatā€™s going on here?

Iā€™ve never seen that error before, but something you could try is to execute the elm binary directly instead of via npx, just to rule out npx/Node.js. Something like this: ./node_modules/.bin/elm make src/Main.elm.

I have a hunch youā€™re gonna get the same error, but good to know for sure!

Thanks all for the answers. Iā€™ve settled for elm-tooling. Worked best for the ARM build.

Thanks @lydell!

I actually didnā€™t get the same error which is awesome!

Pretty stupid of me but I guess you need something in the file in order to make it!

So far so good now that Iā€™ve put some elm code in the file.

Thanks for the help!

Okay so how are you fine folk managing to run elm format and things if you are on an arm machine? Itā€™s a real shame that binary hasnā€™t been updated! Compared to getting my Go environment setup this is feeling pretty confusing! ā€˜npx elm-formatā€™ works as expected.

I use nvim most of the time with null-ls. I can see from the docs that it is attempting to run the elm-format command which obviously wonā€™t work. Let me know if you have any ideas. Worked fine on my old Intel Mac with my current nvim config.

Edit:

I just used brew despite the warning that itā€™s not compatible with Ventura and it all seems to work fine. It did say arm64_Monterey on the installer but seems to work fine!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.