文章/教程 anchor build 报错 rustc 1.79.0-dev is not supported by the following package. 处理办法

tt · 2025年03月20日 · 62 次阅读

报错如下: rustc 1.79.0-dev is not supported by the following package. Note that this is the rustc version that ships with solana tools and not your system's rustc version. Use "solana-install update or hiover to https://docs.solanalabs.com/cli/install to install a newer version.bytemuck_derive@1.9.2 requires rustc 1.84Either upgrade rustc or select compatible dependency versions withcargo update @kxcurrent-ver>--precise `wherelatest version supporting rustc 1.79.0-dev

原因 是因为 bytemuck derive@1.9.2 这个依赖 rust1.84 版本,但目前所有的 solana 版本内置的 rust 最高版本是 1.79,

处理方式 : 1: 运行 argo update -p bytemuck_derive --precise 1.7.0 这个命令,锁定到兼容 1.79 的版本,这样就可以了, 2: 或者 在 Cargo.toml 中 加入 [dependencies] anchor-lang = "0.30.1" bytemuck_derive = "=1.7.0" # 锁定到兼容 1.79 的版本

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号