简体   繁体   中英

How to install erd with cabal install without Could not resolve dependencies error?

I'm trying to install erd so I can produce some database table entity relationship diagrams using erd and graphviz .

I have been doing all of the following installs in a Git-Bash command line prompt on a Windows 64 PC.

First I installed Haskell (with cabal included) from enter link description here , then I did a

cabal update

before attempting the actual install of erd with these results

$ cabal install erd
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: base (dependency of erd-0.1.3.0)
rejecting: base-4.8.2.0/installed-140... (conflict: erd => base==4.7.*)
rejecting: base-4.8.2.0, 4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1,
4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2,
4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint
requires installed instance)
Dependency tree exhaustively searched.

I saw where a reset sometimes helps

rm -rf ~/.ghc ~/.cabal

But in my case it didn't change the results, I still see "Could not resolve dependencies"

Since erd is an executable, I would just install it using stack :

Instructions for installing stack may be found here:

https://github.com/commercialhaskell/stack/blob/master/doc/install_and_upgrade.md

The run these commands in the shell:

cabal get erd-0.1.3.0
cd erd-0.1.3.0
stack init --resolver lts-2.22
stack build

The last command report something like:

Installing executable(s) in
{some directory}/erd-0.1.3.0/.stack-work/install/x86_64-osx/lts-2.17/7.8.4/bin

We are using lts-2.22 since erd-1.3.0 requires base-4.7.

This is most probably because erd is a really old package and in the package description it says

Properties
Version  0.1.3.0
Change log  None available
Dependencies    base (==4.7.*)
              , bytestring (==0.10.*)
              , containers (==0.5.*)
              , graphviz (==2999.*)
              , parsec (==3.1.*)
              , text (==1.*) [details]

If you use the latest compiler ghc-7.10 or even ghc-8.0 - the current version of base is packaged up with it - which is of today (2016-05-02) base-4.8 which is incompatible with your project.

So best switch to an older compiler version (ghc-7.8) or try to download the package with cabal get erd and adjust the cabal file to base == 4.8.* and give it a try.

这对我cabal install --allow-newer base erd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM