堆栈:'hdevtools is a library dependency, but the package provides no library needed since my-app is a build target.'
Stack: 'hdevtools is a library dependency, but the package provides no library needed since my-app is a build target.'
我试图将 hdevtools
添加到我的堆栈项目中,所以我 运行 stack build hdevtools
。安装似乎成功,我的文本编辑器停止报告通过堆栈安装的导入库(如 aeson 和 tasty)丢失。
但是,当我将此行添加到我的 package.yaml
文件的 dependencies
部分时出现了问题:
- hdevtools >= 0.1 && < 1
然后再次尝试 运行 stack build
。我收到以下错误输出:
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for my-app-name-0.1.0.0:
hdevtools is a library dependency, but the package provides no library
needed since my-app-name is a build target.
Some different approaches to resolving this:
* Consider trying 'stack solver', which uses the cabal-install solver to attempt
to find some working build configuration. This can be convenient when dealing
with many complicated constraint errors, but results may be unpredictable.
Plan construction failed.
我尝试了 运行ning stack solver
,但抛出了记录在案的异常 here。
如何将 hdevtools 声明为我的项目的依赖项?
How can I declare hdevtools as a dependency of my project?
hdevtool
是一个可执行文件,cabal 没有开发依赖的概念(就像在 npm 等其他包管理器中一样)。因此,您所能做的就是全局安装 hdevtools
并使其正常工作。
@alexis-king 建议在 this guide 中使用 stack build --copy-compiler-tool hdevtools
,在标题为 设置编辑器集成.
的部分
这适用于当前项目和使用相同 GHC 版本的其他项目,但是当您升级到新的 GHC 版本时,您将需要再次 运行 它。
国王指南的更多背景信息:
As mentioned above, stack install is not what you want. Tools like ghc-mod, hlint, hoogle, weeder, and intero work best when installed as part of the sandbox, not globally, since that ensures they will match the current GHC version your project is using.
我试图将 hdevtools
添加到我的堆栈项目中,所以我 运行 stack build hdevtools
。安装似乎成功,我的文本编辑器停止报告通过堆栈安装的导入库(如 aeson 和 tasty)丢失。
但是,当我将此行添加到我的 package.yaml
文件的 dependencies
部分时出现了问题:
- hdevtools >= 0.1 && < 1
然后再次尝试 运行 stack build
。我收到以下错误输出:
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for my-app-name-0.1.0.0:
hdevtools is a library dependency, but the package provides no library
needed since my-app-name is a build target.
Some different approaches to resolving this:
* Consider trying 'stack solver', which uses the cabal-install solver to attempt
to find some working build configuration. This can be convenient when dealing
with many complicated constraint errors, but results may be unpredictable.
Plan construction failed.
我尝试了 运行ning stack solver
,但抛出了记录在案的异常 here。
如何将 hdevtools 声明为我的项目的依赖项?
How can I declare hdevtools as a dependency of my project?
hdevtool
是一个可执行文件,cabal 没有开发依赖的概念(就像在 npm 等其他包管理器中一样)。因此,您所能做的就是全局安装 hdevtools
并使其正常工作。
@alexis-king 建议在 this guide 中使用 stack build --copy-compiler-tool hdevtools
,在标题为 设置编辑器集成.
这适用于当前项目和使用相同 GHC 版本的其他项目,但是当您升级到新的 GHC 版本时,您将需要再次 运行 它。
国王指南的更多背景信息:
As mentioned above, stack install is not what you want. Tools like ghc-mod, hlint, hoogle, weeder, and intero work best when installed as part of the sandbox, not globally, since that ensures they will match the current GHC version your project is using.