Mabel Oza
Mabel Oza

Reputation: 747

Installing Anchor on a MacOS -> Anchor versions are not matching up

New to using Anchor for Solana. I just installed Anchor along with Solana and Rust, Solana and Rust were successfully installed, but I have been having issues with Anchor.

Whenever I check the Anchor version or do anything like Anchor init, I get an error stating that the Anchor version installed is incorrect.

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".

The error is self-explanatory, I need the Anchor version 0.18.2. The problem is that this version of Anchor doesn't exist, if you look at the github page the latest version is 0.18.0.

https://github.com/project-serum/anchor/releases/tag/v0.18.0

I am following the instructions found on the Anchor page (https://project-serum.github.io/anchor/getting-started/installation.html), is there a different fork/version of the Anchor project I should be using?

Thank you all for your contribution!

Upvotes: 7

Views: 5290

Answers (1)

Tarek Adam
Tarek Adam

Reputation: 3535

If you are using MacOS to install Anchor

  1. Install Solana
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"
  1. Install Yarn
npm install -g yarn
  1. Install Rust Cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Install Anchor by building the Rust project from Github and then installing the dependencies
cargo install --git https://github.com/project-serum/anchor --tag v0.18.0 anchor-cli --locked
npm install -g @project-serum/anchor

Note: Make sure the versions are the latest

Upvotes: 5

Related Questions