Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'vue' is not recognized as an internal or external command on windows #347

Closed
aankittcoolest opened this issue Feb 11, 2017 · 33 comments
Closed

Comments

@aankittcoolest
Copy link

  1. Node version : v6.9.5
  2. npm version: 3.10.10
  3. vue version: vue@2.1.10
  4. vue-cli version: vue-cli@2.8.1

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
@posva
Copy link
Member

posva commented Feb 11, 2017

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 posva closed this as completed Feb 11, 2017
@aankittcoolest
Copy link
Author

@posva Thanks for the spontaneous reply 👍

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

Thanks a lot!

@posva posva changed the title vue init throwing error while running on windows 'vue' is not recognized as an internal or external command on windows Feb 11, 2017
@posva
Copy link
Member

posva commented Feb 11, 2017

Thanks for sharing it! It may help other people

@fernandoSalome
Copy link

fernandoSalome commented May 5, 2017

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

@frequency-design
Copy link

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.

@frequency-design
Copy link

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.

@Hujjat
Copy link

Hujjat commented Jul 18, 2017

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.

@Daltimore
Copy link

thanks hujjat. you saved a life.

@gohance
Copy link

gohance commented Feb 7, 2018

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

@Hujjat
Copy link

Hujjat commented Feb 9, 2018

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

@suvrodattamitu
Copy link

@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"

@web-developer1
Copy link

@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!

@bizoregon
Copy link

Thanks @Hujjat !

@amulyachennaboyena
Copy link

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?

@mockingloris
Copy link

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.

@zahafyou
Copy link

zahafyou commented Nov 3, 2018

thanks @Hujjat

@CelticParser
Copy link

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

Use:
npm install -g @vue/cli

@alfiesalano001
Copy link

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

@palakvasani
Copy link

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.

@suvrodattamitu
Copy link

suvrodattamitu commented Mar 18, 2019 via email

@alanlcardoso
Copy link

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

@xzyaoi
Copy link

xzyaoi commented Nov 9, 2019

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

@rodolfoberlezi
Copy link

That is what I was missing @xzyaoi

@SimeonVSimeonov
Copy link

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

@yinca7
Copy link

yinca7 commented Oct 8, 2020

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!!

@swapmeet25
Copy link

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?

@Alphapluse
Copy link

Thanks Hujjat and yinka7 ...I had this problem but with your help fix.

@Lazy-poet
Copy link

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

how then do I set this path please? I've been struggling with it but no help. I installed vue with yarn

@AntonShumin
Copy link

AntonShumin commented May 1, 2021

Hujjat's answer is from 2017,
npm install --global vue-cli will install vue cli 2, for cli 3 use npm install -g @vue/cli

@xzyaoi
Copy link

xzyaoi commented May 2, 2021

@Lazy-poet If you are still struggling with this, take a look at https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

A quick google search on how to set path on windows should help.

@fede-2110
Copy link

fede-2110 commented Dec 10, 2021

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

Thank you so much!

@Adxell
Copy link

Adxell commented Apr 7, 2022

thank u <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests