这些是我在package.yaml中的依赖项:
dependencies:
- weasel
- network
- HTTP
- bytestring
但我仍然收到错误消息
Could not find module ‘Network.HTTP.Base’
Use -v to see a list of the files searched for.
import Network.HTTP.Base
导入时
答案 0 :(得分:0)
首先,确保将package.yaml缓冲区保存到磁盘。
第二,假设您使用的是stack
,请确保没有看到以下警告:
Warning: /Users/dan/scratch/foo/foo.cabal was modified manually. Ignoring
/Users/dan/scratch/foo/package.yaml in favor of the cabal file. If you
want to use the package.yaml file instead of the cabal file, then
please delete the cabal file.
```
如果您 看到此警告,请检查foo.cabal
文件中可能需要保留的内容,然后将其移植到package.yaml
文件中,然后删除foo.cabal
文件,以便hpack可以生成一个新文件。
第三,确保此dependencies
部分与您当前尝试构建的特定目标有关。例如,如果这些列在库依赖项中,但未在测试套件依赖项中列出,则相应的模块将 not 对测试套件不可用。如果在顶层指定了依赖项,那么实际上它们应可用于所有构建目标。