Vue-cli: 'vue' is not recognized as an internal or external command on windows

Created on 11 Feb 2017  Â·  26Comments  Â·  Source: vuejs/vue-cli

  1. Node version : v6.9.5
  2. npm version: 3.10.10
  3. vue version: [email protected]
  4. vue-cli version: [email protected]

Commands fired

npm install -g vue-cli
npm install -g vue
vue install wepack test

Following error is thrown

'vue' is not recognized as an internal or external command,
operable program or batch file.

Tried workouts (but same failure result)

  1. npm unistall -g vue-cli ➡npm install -g vue-cli
  2. npm cache clean

Most helpful comment

I had the same issue.
Here the quick fix.

after running the following command (as Admin)
npm install --global vue-cli

It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm

at least for me it's there.

To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

All 26 comments

npm install -g vue

That's not necessary 🙂 It installs the vue packages

You're probably missing the the bin path. You can find some help here: http://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8

@posva Thanks for the spontaneous reply :+1:

This thread solved the issue from the same page :arrow_down:
http://stackoverflow.com/a/32159233/5133699

Thanks a lot!

Thanks for sharing it! It may help other people

It's just add in your variable path of windows the path of Vue.js

variable_path

This is the way : C:\Users{YourUser}\AppData\Roaming\npm

IN my computer

Hi,

I'm having the same issue, I've set up: System > Enviroment Variables > System Variables > Path >

C:\Users\Admin\AppData\Roaming\npm\node_modules\vue-cli\bin

npm install -g vue-cli, looks to have installed the files in the AppData folder.

I'm running the following:

node -v
v8.1.2

npm --version
5.0.4

Windows 10.

I'm getting the following error: 'vue' is not recognized as an internal or external command,
operable program or batch file.

I followed the same idea and got the zf cli working by adding the bin to the path in Enviroment Variables, not sure why this isn't working.

Can someone advise on what I'm missing.

A fix for the issue, that worked for me.

On the Vue JS website the following is used to install vue-cli

install vue-cli

$ npm install --global vue-cli

create a new project using the "webpack" template

$ vue init webpack my-project

install dependencies and go!

$ cd my-project
$ npm install
$ npm run dev

Instead of installing: npm install --global vue-cli
I used: yarn global add vue-cli

Before I did the above, I uninstalled node js version v8.1.2 and installed the recommended version v6.11.0 (not sure this really made a difference, but it was part of what I did). Then I reinstalled Git from the Git website using the downloadable installer.

I had the same issue.
Here the quick fix.

after running the following command (as Admin)
npm install --global vue-cli

It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm

at least for me it's there.

To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

thanks hujjat. you saved a life.

hi @Hujjat i have no vue.cmd inside by /AppData/Roaming/npm after installing vue-cli. How to fix this?
I already follow all the instruction above, nothing works for me

@gohance Do you have npm ? you must face any error if it's not working for you ???

@Hujjat is awesome.. in my case command: setx /M path "%path%;%appdata%\npm" first did not work for me.. then i gave path to Path then it works properly.. my final command was. etx /M Path "%path%;%appdata%\npm" . it is just for your environment variables.. it may be Path or path just see what it is in your pc.. and if not create one . using Path or path. and use 1)setx /M path "%path%;%appdata%\npm" or 2)setx /M Path "%path%;%appdata%\npm"

@suvrodattamitu thanks for posting that. I was trying everything from the start and saw your comment when nothing actually worked for me. Then I went back and changed the variable path from 'PATH' to 'path' which worked like a charm. Didn't realize that case sensitive would be such a big deal. Glad I saw your comment, cheers!

Thanks @Hujjat !

I've read and found that running npm config set prefix /usr/local then re-running npm install -g vue-cli has fixed my issue? Not sure whether this was necessary though?

I am running a windows 8.1 64bit architecture.
This problem seems to be cos I used a combo of nvm-windows and Yarn.
I installed nvm-windows
Then Installed node version 8
Then Yarn
Then used Yarn to install Vue-cli
Then when I do 'vue --version' it throws an error : vue is not recognized as an internal ...

My current fix is installing vue-cli via npm instead of Yarn.

thanks @Hujjat

Keep in mind that the package is no longer vue-cli.

Use:
npm install -g @vue/cli

  1. delete "node_modules" folder
  2. run - npm install
    2019-03-06_9-41-42

I had the same issue.
Here the quick fix.

after running the following command (as Admin)
npm install --global vue-cli

It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm

at least for me it's there.

To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

Thank you so much! I debugged this for 2 hrs and this was very very helpful. Thanks again.

thanks too

On Sun, Mar 17, 2019 at 11:45 PM palakvasani notifications@github.com
wrote:

I had the same issue.
Here the quick fix.

after running the following command (as Admin)
npm install --global vue-cli

It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm

at least for me it's there.

To use vue as command in cmd. Open the cmd as admin and run the the
following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

Thank you so much! I debugged this for 2 hrs and this was very very
helpful. Thanks again.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/vuejs/vue-cli/issues/347#issuecomment-473688443, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ASWZ_IwnDu_tMymtK6_4nVqP0Ky2VkNaks5vXn8pgaJpZM4L-NlJ
.

I had the same issue.
Here the quick fix.
after running the following command (as Admin)
npm install --global vue-cli
It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm
at least for me it's there.
To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"
Now restart the cmd and run the vue again. It should work just fine.

Thank you so much! I debugged this for 2 hrs and this was very very helpful. Thanks again.

Works very well!!! TKS

Just for information, If you are using yarn, C:\Users\{username}\AppData\Local\Yarn\bin also needs to be in PATH.

That is what I was missing @xzyaoi

To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

You need to make it clear that this command will completely replace everything in PATH

I had the same issue.
Here the quick fix.

after running the following command (as Admin)
npm install --global vue-cli

It will place the vue.cmd in the following directory
C:\Users\YourUserName\AppData\Roaming\npm

at least for me it's there.

To use vue as command in cmd. Open the cmd as admin and run the the following command.
setx /M path "%path%;%appdata%\npm"

Now restart the cmd and run the vue again. It should work just fine.

Thank you very much!!

Been reading through all these comments. Seems this one solution is a fix.
setx /M path "%path%;%appdata%\npm" .. THIS DOES NOT WORK.
Anyone else try anything else with success?

Was this page helpful?
0 / 5 - 0 ratings