Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'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>
like image 521
Touha Avatar asked Jun 06 '19 09:06

Touha


4 Answers

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

like image 105
Eyal Avatar answered Nov 13 '22 21:11

Eyal


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

like image 39
Daniel Methner Avatar answered Nov 13 '22 23:11

Daniel Methner


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

like image 37
Meena Chaudhary Avatar answered Nov 13 '22 23:11

Meena Chaudhary


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.

like image 1
Alalade Samuel Avatar answered Nov 13 '22 21:11

Alalade Samuel