ConnectionTimeout when running elm init on WSL2

Hello everyone, after a long hiatus from Elm I decided to use it for a small project again.
In the meantime I changed my development setup and am now working mostly on Windows through WSL2.

I installed Elm following the instructions for Linux on the website.

When trying to initialize a project with elm init it fails because of a ConnectionTimeout when trying to access https://package.elm-lang.org/all-packages. Getting the page with curl works without problems. I’m not behind any extra firewalls or proxies. It seems other people have had the same issue but those posts are either closed or abandoned without any real response other than “I switched back to Mac” or similar.

I realize I could install Elm on Windows directly, but there are factors preventing me from doing so.

Thanks for reading and for any comments you may have :slight_smile:

I’m not sure what may be happening to you but just to give you hope that it works well, I run WSL2 with Ubuntu 20.04 LTS, and I have elm installed with npm in the package version 0.19.1-5 and everything works fine.

Just to be sure I switched to the npm version (and updated my system packages). Still no luck. It seems I have a very similar setup to you. are you using WSL1 or 2?

WSL2

C:\>wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-20.04    Running         2

I have no idea what was actually broken, but running wsl -t <Distro Name> fixed the problem and I can now create projects again. I guess some transient broken state somewhere. By now I’ve already implemented my small project in something else, but at least for the future I can use Elm again^^

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