5

Recently Installed VS Code in my Ubuntu14.04 . Installed Haskell using Stack.

Getting these errors. Kindly help.

Error: Couldn't start ghc-mod process Error: Command failed: ghc-mod version

Error: Cannot hlint the haskell file. The hlint program was not found. Use the 'haskell.hlint.executablePath' setting to configure the location of 'hlint' enter image description here

seairth
  • 1,966
  • 15
  • 22
user1900238
  • 119
  • 3
  • 11

1 Answers1

3

It looks like you've installed 2 extensions for vscode, one for linting and one for running ghc-mod, but you don't have hlint or ghc-mod installed.

If you are using this ghc-mod extension, make sure you have ghc-mod installed through cabal or through stack.

IF you are using this linter extension, make sure you have hlint installed through cabal or through stack.

To install with cabal, run: cabal install hlint and cabal install ghc-mod

To install via stack, see the stack documentation.

Llewey
  • 8,684
  • 2
  • 26
  • 19
  • I was told not to install Haskell through Cabal on IRC and was directed to use Stackage since it keeps the system packages and Haskell Libraries separate. Hence I did install Haskell using Stack, but couldn't find Hlint orGhc-mod documentation in Stack. How to go ahead than. I saw I could do Stack install Hlint. But not sure about GHc-mod – user1900238 Jul 12 '16 at 09:57
  • You need to make sure that `ghc-mod` and `hlint` are available to vscode. You can do this in 2 ways, both of which require you to find the paths to the executables you just installed. 1) add ghc-mod and hlint to your system "path". http://askubuntu.com/questions/381958/add-program-to-path OR 2) Configure the extensions to tell them where the executable is. The README for both extensions tell you which configuration variable to set. – Llewey Jul 13 '16 at 09:55