Touha
Touha

Reputation: 617

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

Upvotes: 20

Views: 54594

Answers (9)

Gabi
Gabi

Reputation: 41

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.

Upvotes: 3

Duraisaravanan
Duraisaravanan

Reputation: 21

  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

Upvotes: 2

Eyal
Eyal

Reputation: 4763

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

Upvotes: 13

W Kenny
W Kenny

Reputation: 2069

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

Upvotes: 1

Muhammad Azam
Muhammad Azam

Reputation: 254

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

Upvotes: 0

twizelissa
twizelissa

Reputation: 161

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

Upvotes: 1

Alalade Samuel
Alalade Samuel

Reputation: 672

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.

Upvotes: 1

Daniel Methner
Daniel Methner

Reputation: 607

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

Upvotes: 5

Meena Chaudhary
Meena Chaudhary

Reputation: 10665

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

Upvotes: 35

Related Questions