我编译了“Hello world”程序
import Html exposing (text)
main =
text "Hello, World!"
在Windows上使用elm 0.17,没有编译错误:
elm make hello.elm --output index.html
当我在index.html上打开Chrome时,我会看到一个空白页面。 Chrome的控制台在index.html中显示2个错误:
Uncaught ReferenceError: _elm_lang$virtual_dom$VirtualDom$text is not defined
Uncaught ReferenceError: Elm is not defined
如果我在该文件上运行elm-reactor,我也会在控制台中看到一个白页和类似的错误。
不知何故,路径丢失了......这是elm-package.json文件:
{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-lang/html": "1.0.0 <= v < 2.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}
我该怎么办?
答案 0 :(得分:6)
我通过删除elm-stuff子目录来修复它。在下一个make,它会重新安装丢失的软件包,一切正常。