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.