You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法编译Move:执行aptos move compile报错“Profile superuser未找到”原因咨询

问题原因及解决方法

报错原因

你使用的superuser是Aptos CLI配置文件中的profile名称,但--named-addresses参数的语法规则是:如果要引用profile对应的地址,必须用profile:<profile名>的格式;直接写profile名称会被CLI当作普通的地址字符串解析,导致找不到对应的profile配置,从而抛出错误。

正确用法示例

方式1:直接指定具体地址值

aptos move compile --package-dir aptos-move/move-examples/hello_blockchain/ --named-addresses hello_blockchain=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

方式2:引用已配置的profile地址(正确格式)

aptos move compile --package-dir aptos-move/move-examples/hello_blockchain/ --named-addresses hello_blockchain=profile:superuser

补充说明

--named-addresses的作用是将Move包中声明的命名地址映射为实际的链上地址,支持两种输入:

  • 十六进制格式的完整地址(如0x1)
  • 用profile:<profile名>引用CLI配置中已存在的profile对应的账户地址

内容的提问来源于stack exchange,提问作者movingprog

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 10:29:52