Reputation: 1495
I'm trying to install Vue-cli environemnt via NPM.
npm install --global vue-cli
After that I want to create project
vue init webpack my-project
And I get an error
'vue' is not recognized as an internal or external command,
operable program or batch file.
I've read some solutions, most of them concern changing
PATH to C:\Users{YourUser}\AppData\Roaming\npm
Didn't work for me. Can anyone help.
Upvotes: 12
Views: 32320
Reputation: 1
for Yarn -> need to install it:
npm install -g yarn
Installing Vue CLI Package:
yarn global add @vue/cli
To create project:
vue create project-name
To run:
yarn serve
Uninstalling:
yarn global remove @vue/cli
I follow "npm" package manager instead of "yarn" package manager console because yarn give me a problem while installing it;
command to install Vue CLI:
npm install -g @vue/cli
For to create Vue project:
vue create "project-name"
For to run Vue project:
npm run serve
Upvotes: 0
Reputation: 10628
yarn global add @vue/cli
did not work for me
So I removed using yarn global remove @vue/cli
Then I installed using npm install -g @vue/cli
and its working fine.
Upvotes: 1
Reputation: 535
I was installing @vue/cli
using yarn, i.e. I ran
yarn global add @vue/cli
Calling vue
on windows did not work after the installation ('vue' is not recognized as an internal or external command)
What I needed to do was to add C:\Users\<MY USERNAME>\AppData\Local\Yarn\bin
to path.
Upvotes: 1
Reputation: 453
1)Try to remove all the node files, npm and nvm files/folders.
2)Also, remove the PATH of node js and nvm from environment variables.
3)try commands:
node -v
npm -v
nvm -v
above commands only to make sure that all the entities related to node are uninstalled. 4) install node, and if necessary install nvm(optioal), then run command
npm install -g @vue/cli
above procedure proven to be useful for me. Just give it a try!
Upvotes: 0
Reputation: 1445
I follow these commands, It's work fine for me.
npm install -g vue-cli
npm install -g vue
Edit the System environment variables, and enter the following path, and if still having a problem just try to add a path in System User Variables
C:\Program Files\nodejs\node.exe;
C:\Users\{UserName}\AppData\Roaming\npm
Check vue installed in C:\Users{UserName}\AppData\Roaming\npm
Upvotes: 10
Reputation: 11
I had the same problem after searching a lot I found this solution:
You need to Add C:\Program Files\nodejs to your PATH environment variable. To do this follow these steps:
You will have to restart any currently-opened command prompts before it will take effect.
I hope it works, good luck!
Upvotes: 1
Reputation: 31
had the same issue, i deleted my node_modules and re-install and it worked
Upvotes: 1
Reputation: 31
yarn add @vue/cli-service
or
npm install @vue/cli-service
is what worked for me
Upvotes: 3
Reputation: 11
I found this same issue with another possible problem. I had
[email protected] installed globally
npm list -g --depth=0 will display your globals
I simply uninstalled create-react-app
npm uninstall create-react-app
Vue vue-cli-service now works as expected.
Upvotes: 1
Reputation: 2870
I have faced simillar issue and re-installing vue-cli didn't work for me. Strange thing is vue and vue-cli get installed successfully but once I tried to create project by using below command
vue init webpack myfirstproject
I get below error:
'vue' is not recognized as an internal or external command,operable program or batch file.
Tried various solutions but nothing worked for me. Please find my NPM and Node details below:
NPM version: 6.2.0
Node version: 8.7.0
Actually the issue was "vue-cli" is not supporting to my Node(8.7.0). It requires Node >=8.9. Once I upgraded my Node version. everything is working fine.
upgrading your Node version is the correct way to deal with this issue
Upvotes: 2
Reputation: 1495
Well, problem was solved by simply deleting everything related to vue-cli installed before. And re-installing vue-cli.
Upvotes: 2