Search code examples
ubuntu-18.04elm

How do I install elm-repl despite these errors?


I'm brand new to elm and web development generally. I'm working through the guide here. I installed Sublime Text and the elm compiler. I'd like to use a REPL to play around with things easily. I tried installing it through the instructions here, where I run this:

cabal update ; cabal install elm-repl

But I get this error:

Resolving dependencies...
Configuring http-client-0.5.8...
Building http-client-0.5.8...
Failed to install http-client-0.5.8
Build log ( /home/matt/.cabal/logs/http-client-0.5.8.log ):
cabal: Entering directory '/tmp/cabal-tmp-9068/http-client-0.5.8'
Configuring http-client-0.5.8...
Building http-client-0.5.8...
Preprocessing library http-client-0.5.8...
[ 1 of 19] Compiling Network.PublicSuffixList.Types ( publicsuffixlist/Network/PublicSuffixList/Types.hs, dist/build/Network/PublicSuffixList/Types.o )
[ 2 of 19] Compiling Network.PublicSuffixList.Serialize ( publicsuffixlist/Network/PublicSuffixList/Serialize.hs, dist/build/Network/PublicSuffixList/Serialize.o )
[ 3 of 19] Compiling Network.PublicSuffixList.DataStructure ( publicsuffixlist/Network/PublicSuffixList/DataStructure.hs, dist/build/Network/PublicSuffixList/DataStructure.o )
[ 4 of 19] Compiling Network.PublicSuffixList.Lookup ( publicsuffixlist/Network/PublicSuffixList/Lookup.hs, dist/build/Network/PublicSuffixList/Lookup.o )
[ 5 of 19] Compiling Network.HTTP.Client.Util ( Network/HTTP/Client/Util.hs, dist/build/Network/HTTP/Client/Util.o )
[ 6 of 19] Compiling Data.KeyedPool   ( Data/KeyedPool.hs, dist/build/Data/KeyedPool.o )
[ 7 of 19] Compiling Network.HTTP.Client.Types ( Network/HTTP/Client/Types.hs, dist/build/Network/HTTP/Client/Types.o )
[ 8 of 19] Compiling Network.HTTP.Client.Connection ( Network/HTTP/Client/Connection.hs, dist/build/Network/HTTP/Client/Connection.o )
[ 9 of 19] Compiling Network.HTTP.Client.Body ( Network/HTTP/Client/Body.hs, dist/build/Network/HTTP/Client/Body.o )
[10 of 19] Compiling Network.HTTP.Client.Cookies ( Network/HTTP/Client/Cookies.hs, dist/build/Network/HTTP/Client/Cookies.o )

Network/HTTP/Client/Cookies.hs:152:38: error:
    • Couldn't match expected type ‘Builder’
                  with actual type ‘Data.ByteString.Builder.Internal.Builder’
      NB: ‘Data.ByteString.Builder.Internal.Builder’
            is defined in ‘Data.ByteString.Builder.Internal’
                in package ‘bytestring-0.10.8.1’
          ‘Builder’
            is defined in ‘Blaze.ByteString.Builder.Internal.Types’
                in package ‘blaze-builder-0.3.3.4’
    • In the second argument of ‘($)’, namely
        ‘renderCookies $ output_cookies’
      In the expression: toByteString $ renderCookies $ output_cookies
      In an equation for ‘output_line’:
          output_line = toByteString $ renderCookies $ output_cookies
cabal: Leaving directory '/tmp/cabal-tmp-9068/http-client-0.5.8'
cabal: Error: some packages failed to install:
Elm-0.12.3 depends on http-client-0.5.8 which failed to install.
elm-repl-0.2.2.1 depends on http-client-0.5.8 which failed to install.
http-client-0.5.8 failed during the building phase. The exception was:
ExitFailure 1
http-client-tls-0.3.5.3 depends on http-client-0.5.8 which failed to install.
pandoc-2.1 depends on http-client-0.5.8 which failed to install.

Solution

  • If you've already installed the Elm compiler, you already have the REPL. Try typing elm repl in the shell. Note that there is no hyphen in this command.

    The instructions you are following to install a separate REPL are long out of date.