2016-05-26 20 views
5

Ciao mi basta seguire il doc da: http://elm-lang.org/get-started ma sto bloccato nella parte modulo di ritrovamento:olmo documentazione get-started "non riesce a trovare il modulo"

$ 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! 

ho qualche semplice esempio:

$ 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] 

ottengo un modulo errror mancante:

$ 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)[email protected]:~/lab/sandbox/elm 
$ 

non riesco a trovare whe Re nella documentazione è spiegare il collegamento da

import xxx Exposing yyy 

e l'equivalente di

$ pip install xxx 

risposta

5

È necessario importare il pacchetto utilizzando elm-lang/htmlelm package install elm-lang/html.

Per scoprire quale pacchetto è necessario quando si riceve un tale erore dal compilatore, è possibile andare a http://package.elm-lang.org/ e, facendo una piccola ricerca, scoprire quale pacchetto sta esponendo il modulo necessario guardando nella colonna di destra quando sei nei dettagli di un pacchetto.

Per esempio here vedrete che il pacchetto elm-lang/html sta esponendo i seguenti moduli: Html, Html.App, Html.Attributes, Html.Events e Html.Lazy.

C'è anche an issue chiedendo di migliorare il collegamento tra il modulo e il pacchetto che sta esponendo, in modo che il compilatore potrebbe aiutare di più nel corso del progetto bootstrap

Problemi correlati