刚开始使用 Solana 的 Anchor。我刚刚安装了 Anchor 以及 Solana 和 Rust,Solana 和 Rust 已成功安装,但我在使用 Anchor 时遇到了问题。
每当我检查 Anchor 版本或执行 Anchor init 之类的操作时,都会收到一条错误消息,指出安装的 Anchor 版本不正确。
mabeloza@Mabels-MacBook-Pro ~ % anchor --version
Only x86_64 / Linux distributed in NPM package right now.
Trying globally installed Anchor.
Globally installed anchor version is not correct. Expected "anchor-cli 0.18.2", found "anchor-cli 0.18.0".
该错误是不言自明的,我需要 Anchor 版本 0.18.2。问题是这个版本的 Anchor 不存在,如果你查看 github 页面,最新版本是 0.18.0。
https://github.com/project-serum/anchor/releases/tag/v0.18.0
我按照 Anchor 页面(https://project-serum.github.io/anchor/getting-started/installation.html)上的说明进行操作,是否有我应该使用的 Anchor 项目的不同分支/版本?
感谢大家的贡献!
如果您使用MacOS安装 Anchor
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"
npm install -g yarn
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install --git https://github.com/project-serum/anchor --tag v0.18.0 anchor-cli --locked
npm install -g @project-serum/anchor
注意:确保版本是最新的
| 归档时间: | 
 | 
| 查看次数: | 3700 次 | 
| 最近记录: |