Where are the installed packages?

The Beginning Elm said they are in my home directory(ie., ~/.elm), but I cann’t find them there. Are the location changed in elm-0.19?

Another question(sorry for packing 2 questions in one post): How to install a package using its offline zip file?

The question come from a situation I just got into: I cannot elm install a package(it’s elm-ui BTW) due to some reasons, but I can mannually download the zip file. So I guess I could mannually copy this zip file to the local installed package repo to complete the elm install process.

1 Like

They will be under ~/.elm unless you have changed ELM_HOME to something else. To be more specific they are at ~/.elm/0.19.1/packages if using 0.19.1 version. Note that that directory is only created when you install first package.

That is not supported by Elm compiler. Manually copying package doesn’t work because you would also need to update ~/.elm/0.19.1/packages/registry.dat which uses undocumented binary format.

What error you get when trying to install package?

Just checking - are you using the right elm-ui? elm-ui 1.1.8

There is an older unrelated elm-ui: GitHub - gdotdesign/elm-ui: UI library for making web applications with Elm, which people sometimes get mixed up with, and I don’t think it is on the Elm managed packages, which might explain why it does not install.

Are you running

> elm install mdgriffith/elm-ui

Surprised if this does not work as it is a very popular package.

1 Like

Got it! thank you very much. Regarding the failure of installing package, it’s turned out to be a network issue. I just tried several more times and it’s done :wink:

The installing issue is caused by my poor internet connection.
Yes the gdotdesign/elm-ui did confuse me at first but seconds later I realized its not the same guy :wink:

Yes, a major problem with Elm currently is that packages can only be installed online from https://package.elm-lang.org/ .

As a programmer living in mainland China, I’m used to praying for it not being an issue as they will arbitrarily block websites or online repositories sometimes.

2 Likes

It is another good reason for having a more federated package distribution system, as well as ability to make it easy to work with offline caches of elm packages. You can download this cache of Elm packages, and put them under your ~/.elm folder:

curl -O https://static.lamdera.com/cache/elm-package-cache-2021-02-13.zip && unzip -p elm-package-cache-2021-02-13.zip | tar xf -
4 Likes

Beautiful! this tip is definitly wanted by people like me someday. bookmarked.

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