When running 'stack setup' for ghcjs…

haskell ghcjs stack development

… make sure you don’t have cabal in your path. Otherwise you’ll get odd build errors, and ghcjs will never install: see this issue on the ghcjs issue tracker.