Me, @supermario and @evancz (with the help of some more folks) are working on a new version of the
elm npm package.
- Changed: Binaries are downloaded by npm instead of custom code in the
elm package. No more dependencies or deprecation warnings!
- New: Native macOS ARM binary. No more Rosetta!
- New: Linux ARM binary. Useful for people with such computers, and for Docker on macOS ARM!
Please try it out and let me know how it goes! We’re testing using a temporary npm package until we know everything works.
npm install @lydell/elm
"elm": "0.19.1-5" in your package.json with
"@lydell/elm": "0.19.1-9" and run
I’m especially interested if you:
- Use a package manager other than
- Use a very old Node.js or npm for some reason.
- Use Linux ARM.
- Are behind a corporate proxy or something like that and configure things like
- Use a “probably not the most common setup” in general.
#core-coordination channel on Slack if you want all the details.
I installed it on my M1 iMac.
elm make src/Main.elm works great for https://mammudeck.com. Faster, though improving three seconds to one second isn’t a big deal.
Main.elm has 20444 lines, 630K bytes, and a lot of dependencies.
Really naive question: how does this relate to / interop with Elm Tooling CLI?
I’m running a Mac with an M1 Pro chip and am doing elm development inside a VS Code dev container (via Docker) running aarch64 Debian GNU/Linux 11 (bullseye). I installed the package inside the container and it worked great! Thanks!
Fantastic news, thanks for this.
As far as I’m concerned, it doesn’t work with my current setup with either
elm 0.19.1-5 or
@lydell/elm 0.19.1-9, so nothing new here. My setup is Gulp with Yarn 2, so I guess the gulp-elm plugin that I’m using doesn’t know about Yarn 2. (It only works if elm is absent from my package.json, and the plugin then relies on my global elm install.) Looking forward to switching to
elm-watch on this project
So I tried updating globally: removed global
elm with npm, installed global
@lydell/elm with npm. I see no change when I build so I guess it’s working!
(In case the fix to my unrelated issue above is obvious to anyone, the error I’m getting is “SyntaxError: Invalid or unexpected token” on the beginning
@lydell/elm work with Yarn 2/3. (It might work if you don’t use PnP or whatever – I’m not that into Yarn 2/3.)
@lydell/elm took a lot of inspiration from esbuild’s npm installer. They have some very elaborate workarounds for Yarn 2/3. Since the current
elm package does not work either with Yarn 2/3 I decided to scope that out for some other time. Interesting to hear from a Yarn 2/3 user though!
(What happens is that the package replaces its JS entrypoint with the executable itself as an optimization. Yarn 2/3 does not seem to like that.)
Oh okay, so Yarn (with PnP) is the issue then, not Gulp or the gulp-elm plugin. Might consider going back to npm at some point then I would argue it’s a pretty big issue that it doesn’t work with yarn, but maybe it’s just yarn’s fault, not anticipating enough potentially breaking use cases. Also it’s not blocking since you can just run the global binary.
Thanks for the info!
Just wanted to clarify for other’s reading that Yarn 1 works fine, it’s Yarn “Berry” (v2+) that are problematic.
Is it Yarn’s fault? Well, read this issue: [Bug] SyntaxError when running a "bin" file that isn't authored in JS · Issue #882 · yarnpkg/berry · GitHub (it mentions Elm a couple of times!)
Wow! This is great news!!! I’m sitting behind a corporate firewall and have not been able to install elm through npm due to then elm binary not being downloaded through internal npm proxy.
I have just tested with
"@lydell/elm": "0.19.1-9" and it worked great. Thanks!!!
If the same solution could be applied to elm-format and the other elm-tools it would be awesome.
Just did it on my work computer, an Intel Mac, and I can confirm that it actually works pretty seamlessly to install and run the elm binary.
Thank you everyone for testing! Much appreciated.
Follow this PR to get updates about the progress of the upcoming new official
elm npm package: Free the npm package from third party dependencies by lydell · Pull Request #2287 · elm/compiler · GitHub
It’ll take a while though because there is a lot to review and December can be a busy month.
I have used my 8 years old MacBook Air macOS Mojave for this purpose successfully.
I have first removed the official version with npm -g uninstall elm and installed globally the temporary version npm install @lydell/elm
(To be sure, only the new elm is running, elm must be deleted also from /usr/local/bin folder.)
All seems to work excellent, at least no new problems appeared so far.
Here are some little examples of my tests with elm reactor and elm-spa.
(See also here!
Working with great with
pnpm on my Ubuntu 22.10 machine. Note that I have the following lines in my .npmrc file: