''vue' is not recognized as an internal or external command

everything was installed correctly. but whenever I try to create project, it says "'vue' is not recognized as an internal or external command". I installed and re-installed but didn't work. npm was also added to environmental variable path.

C:\Users\touha\Desktop>npm list -g --depth=0
C:\Users\touha\.npm-packages
`-- @vue/[email protected]


C:\Users\touha\Desktop>vue ui
'vue' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\touha\Desktop>


Solution 1:[1]

Locate vue.cmd and add its location to your PATH

It is added to package manager(npm or yarn) installation. So you may find it at following locations

YARN

C:\Users{YourAccount}\AppData\Local\Yarn\bin

NPM

C:\Users{YourAccount}\AppData\Roaming\npm

Solution 2:[2]

Addition: If setting the path variable and reinstalling @vue/cli does not work, using the node.js command prompt instead might solve the issue.

Solution 3:[3]

just open PowerShell and run: npm install -g @vue/cli

Solution 4:[4]

It seems vue isn't been installed globally for some reasons. This is the step I followed to solve mine:

Firstly, create your desired project folder (say "Vue Project"). This is where you want to create a vue project.

Then create a "node_modules" folder in the Vue Project folder

Then go to your system npm folder C:\Users{YourAccount}\AppData\Roaming\npm

You will see three different "vue" files. Copy them and paste in the Vue Project Folder you created.

Go back to C:\Users{YourAccount}\AppData\Roaming\npm and enter the node_modules folder. You'll see a "@vue" folder. Copy this, and paste it in the node_modules folder you created in the Vue Project Folder.

You can now head back to the CLI and create your project using "vue create my-vue-project" where my-vue-project is your desired vue project name.

Solution 5:[5]

You can try this way it worked for me go to the location of your yarn or npm mine is C:\Users\TED\AppData\Local\Yarn\bin for Yarn C:\Users\TED\AppData\Local\Npm\bin for Npm users TED will be replaced by your user name then copy and add it to your system environment variable

Note in case you don't find AppData make sure you have view hidden file checked

Solution 6:[6]

if you got this error most probably chance package not installed completely check-in C:\Users\dev\AppData\Roaming\npm if you had not found the package under this folder then re-run your command

Solution 7:[7]

I am using Yarn to install @vue/cli.

The way I solve it is via the following steps

  1. Locate your global installed vue.cmd location
  2. Add the vue.cmd directory into System variable Env. For myself, the path is C:\Users{MyAccount}\AppData\Local\Yarn\.bin

Solution 8:[8]

what worked for me:
In a powershell :

npm install vue
npm install -g @vue/cli
C:\Users\{USER}\AppData\Roaming\npm\vue.cmd create {NAME}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Meena Chaudhary
Solution 2 Daniel Methner
Solution 3 Eyal
Solution 4 Alalade Samuel
Solution 5 twizelissa
Solution 6 Muhammad Azam
Solution 7 W Kenny
Solution 8 Gabi