Recently installed the Vue CLI tool on Mac OS and experiencing command not found errors when trying to use Vue from the command line?
Resolving the issue is thankfully fairly straightforward - which is good, as there's nothing more frustrating than wanting to get stuck into development only to be hampered by software configuration issues!
From your command line determine the path to your npm bin folder:
npm bin -g
On our system the following path was returned:
Notice from the above path information that we are using NVM?
Depending on which version of node your system is currently running the path information returned for NVM will change. Bare this in mind if you are using NVM to manage your node installations as this is hugely important!
Copy this path and open your .bash_profile:
sudo nano ~/.bash_profile
Now, within your .bash_profile, set the path so that it is available to your system shell like so:
Obviously change YOUR-USER-NAME-HERE to whatever your Mac user name is!
Save and close your .bash_profile, close the terminal window and open a new session window.
You should now be able to access the Vue CLI like so:
vue --version @vue/cli 4.0.5
Important: If using NVM to switch node installations you will need to adjust the exported path in your .bash_profile otherwise the same command not found error will be returned.