报错如下:rustc1.79.0-devisnotsupportedbythefollowingpackage.Notethatthisistherustcversionthatshipswithsolanatoolsandnotyoursyste
报错如下 : 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 <name>@kxcurrent-ver>--precise <compatible-ver>`where<compatible-ver>latest version supporting rustc 1.79.0-dev
是因为 bytemuck derive@1.9.2 这个依赖rust1.84版本,但目前所有的solana版本内置的rust最高版本是1.79, 所以需要 运行cargo update -p bytemuck_derive --precise 1.7.0
这个命令,来锁定依赖到 1.7.0,这样就可以了,或者 在Cargo.toml中 加入
[dependencies] anchor-lang = "0.30.1" bytemuck_derive = "=1.7.0" # 锁定到兼容 1.79 的版本
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!