Look, AVM exists because Anchor version conflicts are a fucking nightmare. I've wasted entire afternoons debugging why my build broke, only to realize my teammate is using Anchor 0.29 while I'm on 0.30, and some breaking change between versions just destroyed my day.
The nightmare goes like this: You install Anchor CLI with cargo install anchor-cli
, works great for Project A. Then Project B needs an older Anchor version. Now what? Upgrade Project B and risk breaking everything? Downgrade your global Anchor install and watch Project A die? Both options suck.
That's where AVM comes in to save what's left of your sanity. Works like nvm for Node.js - you can switch between Anchor versions per project without nuking your entire setup. Install whatever versions you need, run avm use 0.30.1
, and stop dealing with those "it works on my machine" disasters.
What AVM Actually Does For You
Version Isolation: Each Anchor install lives in its own directory structure, so different projects can't fuck with each other. No more "why did updating Anchor break my other project" moments that make you question your life choices.
Verifiable Builds: For prod deployments, you need verifiable builds with exact version matches. AVM lets you install from specific commit hashes when some bug fix didn't make it into a release but you need it for your deployment. This is crucial when real money is at stake.
Team Coordination: Put anchor --version
requirements in your README so new devs don't waste their first day debugging environment issues. AVM makes it trivial for everyone to run the same version - no more onboarding nightmares.
Feature Testing: Want to try bleeding-edge Anchor features without breaking your production setup? avm install latest
for experimentation, avm use 0.30.1
to get back to stability when things inevitably break.
How AVM Actually Works
OK, enough bitching - here's how this thing actually works. AVM is just a Rust binary that downloads and manages different Anchor CLI versions. You install it once with cargo install --git https://github.com/coral-xyz/anchor avm --force
, and then it handles all the version switching nonsense.
The latest Anchor CLI versions are around 0.30-0.31, but most projects I see are still running 0.30.1 because upgrading is scary and things work fine. AVM supports any version back to the stone age, plus specific commit hashes for when you need to reproduce exactly what went wrong in production.
Storage: Lives in ~/.avm/bin/ for the different Anchor binaries, ~/.avm/versions/ for tracking what's installed. AVM messes with your PATH so the right anchor
binary gets called, but only for that terminal session. Yeah, this means you gotta run avm use
in every new terminal - annoying as hell, but it stops versions from bleeding into other projects by accident.