简体   繁体   中英

Exec format error when stack building Haskell code

I'm trying to stack build my haskell code but all I get is

\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe: startProcess: invalid argument (Exec format error)

multiple times in the terminal with no success. Any suggestions on how to fix this?

This error message suggests that the file in the error message, a cached executable, has been corrupted. If you delete it and rerun your build command, Stack should rebuild it automatically (at least, it did in my tests).

If you get the same error message again or a similar error message for a different file, then that would suggest the problem is more widespread. In that case, I'd suggest uninstalling and reinstalling Stack to see if that clears up the issue. You can uninstall stack by running uninstall-stack in a shell. When the dialog box pops up, make sure you check all the components, including the last two (compilers installed by stack and stack snapshots and configuration), to make sure everything is removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM