Elm : 安装特定版本的 github 库

Elm : install specific version of a github library

我想使用 elm-mdl 库的 v9 b运行ch。

我在 elm-package.json 中将 native-modules 添加到 true,并将 external\elm-mdl 添加到我的 source-directories 列表。

然后我将 "debois/elm-mdl": "9.0.0 <= v < 10.0.0", 添加到 elm-package.json

我 运行 elm-install 但它抱怨:

  ▶ No solution found: Unable to satisfy the following requirements:

- `debois/elm-mdl (< 10.0.0)` required by `user-specified dependency`
- `debois/elm-mdl (>= 9.0.0)` required by `user-specified dependency`

如何让 elm-installelm-make 获取我的库的克隆目录版本?

请查看下面的目录结构和 elm-package.json 输出:

└─ $ ▶ elm --version
0.18.0
└─ $ ▶ cat elm-package.json 
{
    "version": "1.0.0",
    "summary": "Track your life.",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "native-modules": true,
    "source-directories": [
        "src",
        "external/elm-mdl"
    ],
    "exposed-modules": [],
    "dependencies": {
        "danyx23/elm-uuid": "2.1.0 <= v < 3.0.0",
        "debois/elm-mdl": "9.0.0 <= v < 10.0.0",
        "elm-lang/core": "5.1.1 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "mgold/elm-random-pcg": "4.0.2 <= v < 6.0.0",
        "rtfeldman/elm-css": "9.1.0 <= v < 10.0.0",
        "rtfeldman/elm-css-helpers": "2.1.0 <= v < 3.0.0",
        "sporto/elm-dropdown": "1.3.0 <= v < 2.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

└─ $ ▶ cat external/elm-mdl/elm-package.json 
{
    "version": "9.1.0",
    "summary": "Material Design Lite port to Elm",
    "repository": "https://github.com/debois/elm-mdl.git",
    "license": "Apache License, version 2.0",
    "source-directories": [
        "src"
    ...

└─ $ ▶ ls external/elm-mdl/
build_scripts  CONTRIBUTING.md  COPYING.md  demo  elm-package.json  examples  FAQ.md  foo.md  LICENSE.md  Makefile  MIGRATION.md  PR.md  README.md  RELEASE.md  src  TEMPLATES.md  TESTING.md  tests  USERS.md
ashish @ 7567 ~/work/be_autonomous (master) 
└─ $ ▶ ls
Architecture.md  compile_css.sh  elm-package.json  elm-stuff  external    index.css  index.html  index.js  run.sh  src  TAGS  tests

这是我之前准备的答案:

总而言之,删除依赖项中的 elm-mdl 引用,并 link 到定义 Material 模块的文件夹,即:

"source-directories": [
    -- ADD src because Material.elm is under that folder
    "external/elm-mdl/src"
],
"dependencies": {
    -- REMOVE LINE BELOW
    "debois/elm-mdl": "9.0.0 <= v < 10.0.0",
},

然后它会为 elm-mdl 依赖的每个包出错,按照我上面引用的 SO link 在本地添加它们。