你好,我只是跟随文档从:http://elm-lang.org/get-started,但我被阻塞在查找模块部分:
$ 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!我举了一个简单的例子:
$ 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]我发现一个模块丢失的错误:
$ 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
$我找不到在文档中解释连接的位置
import xxx Exposing yyy以及相当于
$ pip install xxx发布于 2016-05-26 08:06:17
您需要使用elm-lang/html导入elm package install elm-lang/html包。
当您从编译器接收到这样一个eror时,要找出您需要的包,您可以转到http://package.elm-lang.org/,然后进行一些搜索,在了解包的详细信息时,通过查看正确的列来找出您需要的包。
例如,这里,您将看到elm-lang/html包公开了以下模块:Html、Html.App、Html.Attributes、Html.Events和Html.Lazy。
还有问题要求改进模块与公开它的包之间的连接,所以编译器可以在项目引导过程中提供更多帮助。
https://stackoverflow.com/questions/37454562
复制相似问题