So after a long time I have looked into my app for further development, and it turned out that I had to update a single package in my project. The experience is sooo bad.
The Elm is 0.19, the OS is Win10. The package is dillonkearns/elm-graphql. The version was 1.1.0. The latest is 4.2.1, I’m gonna get it.
- I type
elm install dillonkearns/elm-graphql@4.2.1
and I get:
elm: TODO show possible arg configurations
CallStack (from HasCallStack):
error, called at ui/terminal/src\Terminal\Args\Error.hs:281:13 in main:Terminal.Args.Error
- Alright, I modify the
elm.json
file by manually changing the version. What should I type in to download it?elm install
, maybe?
– INSTALL WHAT? ---------------------------------------------------------------
I am expecting commands like:
elm install elm/http
elm install elm/json
elm install elm/randomHint: In JavaScript folks run
npm install
to start projects. “Gotta download
everything!” But why download packages again and again? Instead, Elm caches
packages in C:\Users\Namek\AppData\Roaming\elm so each one is downloaded and
built ONCE on your machine. Elm projects check that cache before trying the
internet. This reduces build times, reduces server costs, and makes it easier to
work offline. As a result elm install is only for adding dependencies to
elm.json, whereas elm make is in charge of gathering dependencies and building
everything. So maybe try elm make instead?
But wait, elm install --help
says this:
The
install
command fetches packages from https://package.elm-lang.org for
use in your project:elm install
elm install
- So,
elm install --help
says I could type inelm install
and theelm install
says we’re antagonizing the ways of “JavaScript folks”. “So maybe tryelm make
instead?”, it says.
– INVALID PACKAGE DEPENDENCIES --------------------------------------- elm.json
The dependencies in your elm.json are not compatible.
Well, tell me more about it! But no, it won’t. “not compatible” is all I’ll get.
Did you change them by hand? Try to change it back! It is much better to add
dependencies withelm install
or the dependency management tool in elm reactor.
Surely, I did it by hand. No, it is not much better, elm install
does not work. I can’t upgrade the package.
Please ask for help on the Elm slack <http://elmlang.herokuapp.com/> if you try
those paths and still cannot figure it out!
WHAT?
-
Manually editing the
elm.json
once again, now removing the dependency from the list. Then I doelm install dillonkearns/elm-graphql
and I get the version 1.3.0. Remember, I started with 1.1.0 and wanted 4.2.1. What happened? No info at this point. -
The problem was already touched on the forum, right here:
No solutions that would work both for the author and for me. No improvements since then, I guess.
- After lots of googling around I’ve found this tool helped me a lot with figuring out what versions I’m gonna need to change for updating the dependency:
https://www.markuslaire.com/github/elm-dependencies-analyzer/ linked from here:
Dependencies analyzer for application elm.json - #9 by jxxcarlson
By the way, it’s brilliant and awesome!
- Alright, I’ll do all the modifications and now what?
elm install
will make me remember “JavaScript folks”, not do the right thing.elm make
, maybe?
Starting downloads...
+ elm/http 2.0.0
+ elm/json 1.1.3
+ krisajenkins/remotedata 6.0.1
+ elm/bytes 1.0.8
+ elm/core 1.0.2
+ elm/file 1.0.5
+ dillonkearns/elm-graphql 4.2.1
Dependencies ready!
-- NO INPUT --------------------------------------------------------------------
What should I make though? I need more information, like:
elm make src/Main.elm
elm make src/This.elm src/That.elm
However many files you give, I will create one JS file out of them.
Yes! It downloaded it. And gave me the same information it always does when I simply hit the elm make
about having NO INPUT. I thought that every command has a single function. But here I can see that elm make
can download things and compile things. That was very disinforming until I managed to actually download anything, after correcting dependencies. I couldn’t download things before because there were conflicts between dependency versions and of course I didn’t get any info nor help about those version and/or conflicts.
So it is. Lots of time lost.