Elm get-started documentation "cannot find module"

Hello, I just follow the document: http://elm-lang.org/get-started , but I am blocked in the search module part:

$ mkdir elm $ cd elm $ elm package install Some new packages are needed. Here is the upgrade plan. Install: elm-lang/core 4.0.1 Do you approve of this plan? (y/n) y Downloading elm-lang/core Packages configured successfully! 

I get a simple example:

 $ wget https://raw.githubusercontent.com/elm-lang/elm-lang.org/master/src/examples/buttons.elm ... Enregistre : «buttons.elm» buttons.elm 100%[===========================>] 495 --.-KB/s in 0s 2016-05-26 09:32:19 (150 MB/s) - «buttons.elm» enregistré [495/495] 

I get the missing Errror module:

 $ elm-make buttons.elm I cannot find module 'Html'. Module 'Main' is trying to import it. Potential problems could be: * Misspelled the module name * Need to add a source directory or new dependency to elm-package.json (venv) luis@spinoza :~/lab/sandbox/elm $ 

I can not find where the documentation explains the link from

 import xxx Exposing yyy 

And the equivalent

 $ pip install xxx 
+5
source share
1 answer

You need to import the elm-lang/html elm package install elm-lang/html using elm package install elm-lang/html .

To find out which package you need, when you get such a fragment from the compiler, you can go to http://package.elm-lang.org/ and, by doing a little search, find out which package exposes the module that you need, looking in the right column when you are in the package details.

For example, here you will see that the elm-lang/html package provides the following modules: Html , Html.App , Html.Attributes , Html.Events and Html.Lazy .

There is also a problem with asking to improve the connection between the module and the package that expands it, so the compiler can help more during project bootstrap

+5
source

All Articles