I have tried running npm i -g gatsby-cli and sudo npm i -g gatsby-cli but when I run gatsby --version it still says 2.12.78 even though it also says "Update available 2.12.78 → 3.10.0 | Run npm i -g gatsby-cli to update"
These are my package versions:
npm version: 7.19.1
node version: v16.5.0
Gatsby CLI version: 2.12.78