How to fix "zsh: command not found: vue"?

You have to change the .zhsrc in /Users/[username]/.zshrc and add:

export PATH=$PATH:/Users/[username]/.npm-global/bin

Check that your packages are in npm-global or npm-packages.

To see hidden file use cmd+shift+.


if none of the above work

npm config set prefix /usr/local

and

npm install -g @vue/cli 

that's worked for me


I tried all of the above to no avail on Catalina 10.15.4

The fix is to

  1. uninstall Node and Npm
  2. go to Downloads Node.js and install the 64-bit version from Package
  3. sudo npm install --global vue-cli
  4. vue -V

2.9.6


the first you should remove all vue cli by enter 2 command

sudo npm uninstall --global vue-cli
sudo npm uninstall --global @vue/cli

then you should enter this commad for install the latest version of vue cli

sudo npm install --global @vue/cli@latest

I tried this in mac os 10.15.4 and worked

and then I install

@vue/cli 4.4.6

good luck :)