Today I have quite funny experience, I tried update node & npm to newest version but i get information it is already installed.
brew unlink node && brew link node
Unlinking /usr/local/Cellar/node/17.4.0… 7 symlinks removed.
Linking /usr/local/Cellar/node/17.4.0… 7 symlinks created.
trying check version show wrong one
npm -v
6.14.15
node -v
v12.22.9
I tried everything, from uninstalling, brew cleanup, link, relink, overwrite – without success.
Solution, edit file (in homedirectory):
.zshrc
In content locate & remove line:
export PATH="/usr/local/opt/node@12/bin:$PATH"
After removing restart computer and confirm correct version of node
npm -v
8.3.1
node -v
v17.4.0
Mission successful