'vue' is not recognized as an internal or external command
Asked Answered
A

9

20

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>
Aspersorium answered 6/6, 2019 at 9:31 Comment(7)
try uninstalling it and try npm install -g @vue/cli again, this should suffice to use the vue commandBetatron
tried several times. also uninstalled and reinstalled node js. didn't workAspersorium
Sure looks like you didn't install the vue cli globally.Monad
Did you follow these steps? cli.vuejs.org/guide/installation.htmlMonad
I installed vue using npm install -g @vue/cli as mentioned in the documentationAspersorium
.npm-packages/bin or whatever it's called is not on your PATHTeodoro
yup that worked! @birdspider. actually i added C:\Users\USERNAME\.npm-packages on PATH variables.Aspersorium
E
35

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

Eastman answered 12/8, 2019 at 12:34 Comment(1)
Link how to add it to the PATH on Windows: technig.com/solve-vue-command-not-found-windowsLianne
S
13

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

Sloven answered 28/1, 2022 at 7:27 Comment(1)
It helped me a lot! Thanks!Abundant
L
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.

Levirate answered 6/1, 2020 at 4:40 Comment(0)
I
3

what worked for me: \

  1. Open a PowerShell
  2. npm install vue \
  3. npm install -g @vue/cli \
  4. C:\Users\{USER}\AppData\Roaming\npm\vue.cmd create {NAME}

Note: If you have installed vue using the above command, then use the last command to specify the vue.cmd to PowerShell.

Ite answered 4/5, 2022 at 15:35 Comment(0)
C
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.

Calv answered 1/3, 2021 at 2:29 Comment(0)
D
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

Downtrodden answered 6/6, 2021 at 7:17 Comment(0)
W
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
Wardship answered 16/12, 2021 at 10:1 Comment(0)
A
1
  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
Anacoluthon answered 11/2, 2023 at 5:43 Comment(0)
M
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

Mobility answered 21/10, 2021 at 18:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.