這裏是我的項目的榆樹的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": "5.1.1 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"simonh1000/elm-charts": "3.1.0 <= v < 4.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}
elm-charts
出口名爲Chart
模塊。
在我ChartView.elm
我想導入Chart
module Components.ChartView exposing (..)
import Chart as C exposing (..)
import Html exposing (Html, div)
import Html.Attributes exposing (id, class)
但當榆樹嘗試編譯,我得到的錯誤:
I cannot find module 'Chart'.
Module 'Components.ChartView' 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
,如果我從項目目錄中打開榆樹REPL,我可以如預期的進口圖:
[email protected]:~/elixir/eval$ elm repl
\> import Chart
\>
任何想法爲什麼我編譯時榆樹不能'查找圖表'?
ChartView.elm是在一個子目錄中,還是坐在'elm-package.json'旁邊?你有可能鏈接你的Git倉庫,以便我們克隆它並看看? –
你是否運行了'elm-package install -y',以便下載庫? –
是的,我做了elm-package安裝。當從項目的頂級目錄 – CHsurfer