31

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?

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286

2 Answers2

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.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
Matthew Walton
  • 9,809
  • 3
  • 27
  • 36
  • 3
    Might also be useful for someone: `stack dot --external`. Thanks https://twitter.com/snoyberg/status/793870778672541696 – Konstantine Rybnikov Nov 02 '16 at 17:57
  • 3
    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`. – Mark Seemann Sep 22 '17 at 06:13
  • 2
    For future visitors, `stack list-dependencies` is being deprecated in favour of `stack ls dependencies`. – B. Mehta Aug 30 '18 at 01:26
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

Arghya Saha
  • 5,599
  • 4
  • 26
  • 48