2017-08-12 141 views
1

我想使用elm-mdl庫的v9分支。Elm:安裝特定版本的github庫

我在elm-package.json添加native-modulestrue並添加external\elm-mdlsource-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 

回答

1

這裏有一個答案,我準備早些時候:Using local packages

綜上所述,刪除你的依賴榆樹MDL參考,並鏈接到文件夾中材料模塊被定義,即:

"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取決於o n,根據上面引用的SO鏈接在本地添加它們。

+1

包括'elm-mdl'在你的elm-package.json中的所有依賴關係.. 不會進入遞歸依賴關係。 –