evancz / elm-architecture-tutorial

How to create modular Elm code that scales nicely with your app
https://guide.elm-lang.org/
BSD 3-Clause "New" or "Revised" License
4.17k stars 737 forks source link

Missing package install step? #94

Closed kevgathuku closed 6 years ago

kevgathuku commented 8 years ago

Hi, I am getting started with Elm and when trying to run the examples in this repo through the following commands:

git clone https://github.com/evancz/elm-architecture-tutorial.git
cd elm-architecture-tutorial
elm-reactor

I am getting a runElmProgram is not defined error when I navigate to the examples e.g. http://localhost:8000/examples/1-button.elm I fixed this by running elm-package install to install the dependencies. Is this something that should be in the instructions or was I missing something all along?

reservedwords commented 8 years ago

I ran into a similar issue.

I came across this tutorial via its use on: https://guide.elm-lang.org/architecture/

I was copying the examples into new files and running them in elm-reactor; everything was fine until 5-http.elm, which requires evancz/elm-http so I got a missing package error.

If you're following the tutorial step-by-step, there's nothing explaining the setup you have to do, either if you clone the repo (as in @kevgathuku 's case) or if you're just messing with the code examples in elm-reactor.

Perhaps there should be a little section at the start, either before or integrated into the first example, explaining how to run and manage packages for these examples. I'd suggest explaining it in the case where the reader:

pirj commented 8 years ago

@reservedwords Does everything run ok if you follow the README? Apparently moving files around is a step aside, and is out of the scope of these very basic examples of Elm Architecture and more relate to Elm infrastructure.

Stuck with that as well, in a quite different way, was running elm reactor from examples directory instead of root, but did not expect the README to help me much with that.

Elm is about to keep things easy to understand, and I would rather notice that I've ran elm reactor from a different place than would read the details on how package manager works that early.

teinen commented 6 years ago

Hello.

Currently, this project is updated to Elm 0.19.

In Elm 0.19, elm-package.json is replaced with elm.json. https://github.com/elm/compiler/blob/master/upgrade-docs/0.19.md#elmjson

So I think elm-package install command is not necessary for starting this project.

Thanks.