17

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/cli@3.8.2


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>
Touha
  • 537
  • 2
  • 6
  • 13
  • 2
    try uninstalling it and try npm install -g @vue/cli again, this should suffice to use the vue command – JensW Jun 06 '19 at 09:48
  • tried several times. also uninstalled and reinstalled node js. didn't work – Touha Jun 06 '19 at 09:49
  • Sure looks like you didn't install the vue cli globally. – Olaf Jun 06 '19 at 09:53
  • Did you follow these steps? https://cli.vuejs.org/guide/installation.html – Olaf Jun 06 '19 at 09:54
  • I installed vue using `npm install -g @vue/cli` as mentioned in the documentation – Touha Jun 06 '19 at 10:29
  • 2
    `.npm-packages/bin` or whatever it's called is not on your [PATH](https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10) – birdspider Jun 06 '19 at 11:09
  • yup that worked! @birdspider. actually i added `C:\Users\USERNAME\.npm-packages` on PATH variables. – Touha Jun 06 '19 at 11:23

9 Answers9

27

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

Meena Chaudhary
  • 9,909
  • 16
  • 60
  • 94
9

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

Eyal
  • 4,653
  • 9
  • 40
  • 56
5

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

Daniel Methner
  • 509
  • 1
  • 6
  • 18
2

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}

Gabi
  • 31
  • 3
1

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.

Alalade Samuel
  • 574
  • 5
  • 6
1

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

twizelissa
  • 111
  • 5
1

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
W Kenny
  • 1,855
  • 22
  • 33
0

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

0
  1. Run command prompt as administrator
  2. Run setx /M path "%path%;%appdata%\npm
  3. Restart the command prompt
  4. Now create the Vue project
Mike Szyndel
  • 10,461
  • 10
  • 47
  • 63