Reputation: 2048
I get an error with stack, while trying to install a package.
Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
Invalid package ID: "array-0.5.1.1 base-4.9.1.0 binary-0.8.3.0 bytestring-0.10.8.1"
stack --version works:
Version 0.1.10.0 x86_64
and stack setup returns this:
Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
I reinstalled stack and I get the same error after the new installation. So, I don't know what I'm doing wrong. I need it for using atom.
EDIT
Stack.yaml:
# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project. Settings here do _not_ act as
# defaults for all projects. To change stack's default settings, edit
# '/home/chuck/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
#
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-8.0
Upvotes: 11
Views: 3294
Reputation: 2048
After trying a many things I "found the answer".
The problem was, as epsilonhalbe saw, that I had an old version. So I tried to do this wget -qO- https://get.haskellstack.org/ | sh
and it didn't work, because I had stack on /usr/bin/
so, I removed stack and then tried again wget -qO- https://get.haskellstack.org/ | sh
. I added $HOME/.local/bin/
to the path, and it's working properly.
I hope it can help someone
EDIT
There's a new version of stack, but ghc-mod
just works until the lts-9.0
of stack. So, if you're having troubles with ghc-mod
and your stack version is over 8.0.2
then:
nano /Users/USERNAME/.stack/global-project/stack.yaml
and replace resolver: ---
for resolver: lts-9.0
Then, on the terminal stack solver
and it's gonna work :)
Upvotes: 13
Reputation: 3847
I was blocked by the same problem, unless I check which stack
(or use where stack
as alternative) and I found that I'm using an old version of stack which I installed somehow, and the new version was never accessed when I typed the stack
command ...
Here is the situation when I realized the problem..
If you check stack --version
and get something like Version 0.1.10.0 x86_64
, then it is far away from the current version, the current version I'm using (when answering this question) is Version 1.3.3, Git revision 078cfadeb37a39501eae24732e5c757cc8aca31b x86_64 hpack-0.17.0
If you had confirmed that you are not using the wrong one stack, but the stack version is still too low, you can use stack upgrade --git
to upgrade your stack to the latest version from git (notice that this will take a while).
Hope this helpful.
Upvotes: 4