如何从 `Carton` 卸载

How to uninstall from `Carton`

我有 Carton 环境并将模块从 cpanfile 安装到 ./local/。但是现在我不需要一些模块,想删除一些。

我可以删除 ./local 文件夹并从头开始安装模块,但这需要时间。我找到了 this

carton uninstall Module

但它已经不存在了。

有没有类似carton uninstall的东西?

我的解决方法是删除 local 文件夹并从头开始安装模块:

rm -r local
carton

更新

Note: This can take a while to install from scratch.

为了节省时间你可以通过--notest option to cpanm via PERL_CPANM_OPT:

PERL_CPANM_OPT=--notest carton

或者如果您想阻止查询新版本:

carton install --deployment

这将安装模块而不测试它们。与之前的命令相比,这是安全的,因为您知道该模块之前已安装(测试通过)