"cabal new-install Cabal cabal-install" answered "cabal.exe: Could not read index. Did you call 'checkForUpdates'?" on Windows10

Viewed 867

I've just installed Haskell Platform 8.6.5 in Windows 10 (latest download from https://www.haskell.org/platform/), and when trying "cabal new-update" or "cabal v1-update", it answers with the following error message.

Downloading the latest package list from hackage.haskell.org cabal.exe: Could not read index. Did you call 'checkForUpdates'?

I have found no other question regarding this issue here, and although there is one on GitHub (https://github.com/haskell/cabal/issues/5574), no solutions so far, at least for Windows. Can I use cabal on Windows at all?

I have searched and read all cabal related problems I could, both on here and on GitHub, but most are either for Linux or OS. No good answers for Windows...

1 Answers

I have tried the "cabal -v3 v2-update" and it showed me the file that was missing and its path. At first I tried to restore the file by hand, but someone suggested erasing all the files related to the missing one, and, voilá, cabal regenerate all of them and started to work. The file missing was called 001-index.cache, and I erased all the files 001-index*. The path was C:\Users\fidel\AppData\Roaming\cabal\packages\hackage.haskell.org.

Thanks everybody for the suggestions and help.

Related