Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Operate Offline #991

Closed
defndaines opened this issue Jul 16, 2015 · 6 comments
Closed

Cannot Operate Offline #991

defndaines opened this issue Jul 16, 2015 · 6 comments

Comments

@defndaines
Copy link

You cannot run elm-make or elm-repl without an Internet connection. Here is an example error:

$ elm-repl
Elm REPL 0.4.2 (Elm Platform 0.15.1)
  See usage examples at <https://github.com/elm-lang/elm-repl>
  Type :help for help, :exit to exit
> 4
failed with 'FailedConnectionException2 "package.elm-lang.org" 80 False getAddrInfo: does not exist (nodename nor servname provided, or not known)' when sending request to
    <http://package.elm-lang.org/all-packages?elm-package-version=0.5.1>

This appears to be the problem behind elm-lang/elm-make#34 and I encountered the problem just using the REPL. Establishing a wi-fi connection on my laptop fixed the problem.

@mgold
Copy link
Contributor

mgold commented Jul 16, 2015

The first time you use these tools, they download the standard library and any other libraries you need. This requires an internet connection. I was able to run elm-make without a connection but with the libraries already downloaded.

The REPL and reactor will download to the current directory, and this will cause a few seconds of delay (or this error if you're not connected). A possible improvement is to have a default, standard location for these libraries where the repl can look if you run it where there aren't libraries already.

@rtfeldman
Copy link
Member

@mgold I just tried elm-make offline with everything already downloaded and had no luck (see elm-lang/elm-make#34) - how recently have you been able to do that successfully?

@mgold
Copy link
Contributor

mgold commented Jul 17, 2015

I checked before posting the comment. I just tried it again and it still works, using latest versions of everything.

$ mkdir tmp
$ cd tmp
$ echo "x = 5" > test.elm
$ elm make test.elm 
Some new packages are needed. Here is the upgrade plan.

  Install:
    elm-lang/core 2.1.0

Do you approve of this plan? (y/n) y
Downloading elm-lang/core
Packages configured successfully!
Success! Compiled 32 modules.                                       
Successfully generated elm.js
$ rm -r elm-stuff/build-artifacts/
$ echo "turning off wi-fi now"
turning off wi-fi now
$ elm make test.elm 
Success! Compiled 32 modules.                                       
Successfully generated elm.js

Obviously if you don't have the core libraries installed it's going to try to download them. But I haven't observed the compiler making a network request when it was unnecessary for it to do so.

@rtfeldman
Copy link
Member

Hmmm, now I can't reproduce anymore. Not sure what the difference was, since I had definitely successfully built end-to-end on the project where I was having that problem, so I know everything was downloaded...at any rate, going to close elm-lang/elm-make#34 until I can actually reproduce it.

@evancz
Copy link
Member

evancz commented Jul 19, 2015

I'm gonna say we should follow along at elm-lang/elm-repl#54 which is reporting the same thing.

The root is that you need to get packages off the internet to use them. It may be possible to put them in a central place (perhaps only for elm-lang/core) so that this only needs to happen once per user instead of once per project. Not sure if that's actually a good idea though.

@evancz evancz closed this as completed Jul 19, 2015
@vladanghene
Copy link

I've also experienced this myself at elm-lang/elm-make#156 (comment) but instead of port 80 it's 443. when I run commands with sudo it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants