繁体   English   中英

无法秘密安装Hunit

[英]Can't cabal install hunit

这对Haskell生态系统来说是非常新的。 我正在尝试安装hunit,但是当我运行cabal install hunit我收到以下消息:

Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

cabal: There is no package named 'hunit'. However, the following package name
exists: 'HUnit'.

此消息告诉您两件事。 “安装”是旧命令,“ hunit”不存在。

您的简短解决方案是cabal v2-install --lib HUnit 对于旧的行为,请考虑cabal v1-install HUnit

安装很重要:大款

Cabal过去将所有内容都安装到一个用户或系统范围内的单个商店中,如果有任何软件包在软件包版本上不一致,那么祝您好运。 v2命令移至“ nix样式构建”,其中不同版本可以共存于商店中,并且项目可以通过共享通用软件包的构建而继续受益。 v2命令实际上是前缀为v2-的命令,例如v2-installv2-buildv2-configure

单位不存在

黑客是区分大小写的。 该工具已经通知您,您可能打算安装HUnit而不是hunit

结语:使用--lib

除非通过--lib显式安装,否则v2-install不会公开构建的库。 这减少了名称空间的混乱,使我们需要重新培训一些昂贵的程序员。 要将HUnit用作库并在repl中使用它, --lib按开头所示添加--lib

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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