How do I check what version of a package is installed with stack?
Asked Answered
T

2

32

Within my project's .cabal file I've got the following under the executable section:

executable ArchPkgstatsScraper
  hs-source-dirs:      app
  main-is:             Main.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                       , ArchPkgStatsScraper
                       , text
                       , conduit
                       , html-conduit
                       , http-conduit
                       , xml-conduit
                       , resourcet
                       , transformers

After I've successfully installed / built the above with stack, how could I check which version of xml-conduit is installed?

Typewriting answered 2/11, 2016 at 8:32 Comment(0)
A
36

The command

stack ls dependencies

or for older version of stack:

stack list-dependencies

will list every dependency installed for the current project, along with its version.

Acculturize answered 2/11, 2016 at 9:7 Comment(3)
Might also be useful for someone: stack dot --external. Thanks twitter.com/snoyberg/status/793870778672541696Diffuse
Useful answer (upvoted), but by default it only lists the dependencies of the 'production' code. If you wish to see dependencies of your test code, you can use stack list-dependencies --test.Muscovite
For future visitors, stack list-dependencies is being deprecated in favour of stack ls dependencies.Sisson
J
12

The new command is going to be

stack ls dependencies

which is replacement of stack list-dependencies

You can read more about it here

Jugate answered 21/9, 2018 at 7:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.