Resolving command not found errors when using the Vue CLI

November 8, 2019, 3:39 am
Author: James Griffiths

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:

/Users/YOUR-USER-NAME-HERE/.nvm/versions/node/v10.0.0/bin

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:

export PATH=$PATH:/Users/YOUR-USER-NAME-HERE/.nvm/versions/node/v10.0.0/bin

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.

Categories

« Return to Posts

Post a comment

All comments are welcome and the rules are simple - be nice and do NOT engage in trolling, spamming, abusiveness or illegal behaviour. If you fail to observe these rules you will be permanently banned from being able to comment.