Why after installing vue CLI through npm 6.9.0 dosn't work? - vue.js

When i use this command bellow :
vue create hello-world
I got this message :
'vue' is not recognized as an internal or external command,
operable program or batch file.
After 1 month I still haven't found the solution..
Some informations:
My OS : Windows 10
NPM version : 6.9.0
vue version : 2.6.10
Vue cli installed version : #vue/cli#3.8.2
==>
0 error message when i installed all these packages.
I correctly added npm path on environement variable.

If you set the path correctly then you need to restart the system once because sometimes environment variables need restart after setting the path.
And Do this (If above not works):
Run command as administrator privileged.
npm install --global vue-cli
Set this path to environment variables:
C:\Users\YourUserName\AppData\Roaming\npm
This one too:
In last, restart the cmd, system and run the vue again. It should work just fine.

Related

Command not found after installing #vue/cli

I npm installed #vue/cli with npm install -g #vue/cli. but when I try the vue command I get -bash: vue: command not found. I added export PATH="/usr/local/Cellar/node/11.2.0/lib/node_modules/#vue/cli/bin:$PATH" to my bash profile and when I echo path in terminal I get
/usr/local/opt/openssl/bin:/usr/local/Cellar/node/11.2.0/lib/node_modules/#vue/cli/bin:/Users/jimmymona/.node/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Which does have the path to the vue cli in it: /usr/local/Cellar/node/11.2.0/lib/node_modules/#vue/cli/bin
I also tried sudo installing it but that didn't work either
Anyone know what the issue is?
The path is wrong. The binary resides in /usr/local/Cellar/node/11.2.0/bin rather than .../lib/....
As you'll notice, the file in the latter directory is named as vue.js, not vue.
NPM creates a symlink without the .js extension to it in the bin directory, and that's the actual binary we typically refer to.
Typically we don't use the full path in .bashrc directly (in case the npm global path changes).
Rather, it's recommended to calculate it by combining the result of npm config get prefix and /bin, i.e.
export PATH="$PATH:$(npm config get prefix)/bin"

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

Node version : v8.11.4
npm version: 5.6.0
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.
When I type vue -v also, I am getting the above error
I also added to windows the path of Vue.js
I also noticed that vue.cmd is not coming the following directory
C:\Users\HP\AppData\Roaming\npm
Can anybody please help me to sort the problem
I solved my problem by not running my command terminal as an administrator. I opened my cmder terminal normally by double clicking and it worked.

Problems while setting up vue-cli

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.
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
yarn add #vue/cli-service
or
npm install #vue/cli-service
is what worked for me
Well, problem was solved by simply deleting everything related to vue-cli installed before. And re-installing vue-cli.
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
I found this same issue with another possible problem. I had
create-react-app#1.5.2 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.
had the same issue, i deleted my node_modules and re-install and it worked
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:
Use the global Search to go to "Environment Variables"
Click "Edit system environment variables"
Click "Environment Variables" in the dialog
In the "System Variables" box, search for Path and edit it to include C:\Program Files\nodejs.
You will have to restart any currently-opened command prompts before it will take effect.
I hope it works, good luck!
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.
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.
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!
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

Babel Errors in Cloud 9 IDE

Getting a bunch of babel errors when running npm run dev with the Vue cli.
This only happens in Cloud9.
Any thoughts on what could be the issue or how to disable errors like this before running npm run dev?
All babel related it looks like.
I couldn't re-create the babel error messages but it's possible that it could be caused if npm/node is not up-to-date. (Vue-cli wasn't starting dev server before the installation below)
Is your repository public where you're getting the error messages? Then I could have a look at the errors.
If removing node_modules folder is not helping,
here is how you can create a new IDE workspace for vue.js ($ for commands in bash terminal):
Create a blank Ubuntu workspace
Check that nvm is installed & up-to-date with (check version of install script here):
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
$ nvm install node 6
$ npm i vue-cli -g
$ vue init webpack yourAppName
$ cd yourAppName
$ npm install
$ npm run dev
Click preview to test that Vue server is running as expected
Here is a link to a HelloWorld Vue app in cloud9 ide.
If you have an existing app you can also use git to clone it into your new workspace instead of creating a new app.

babel-cli not working as expected

I had installed babel-cli globally using npm. And I had a script.js file which contains the ES6 code. When I tried to compile that using $babel script.js -o out.js, it just copy all the contains of the script.js to out.js.
As far I concern, it should convert all the ES6 code to ES5.
Even if I run the script.js file without any content, it should show "use strict"; in my out.js. But it shows an empty file. Unable to figure out whats wrong?
Moreover I am unable to understand why "https://www.npmjs.com/package/babel-cli" says to install babel-cli globally where as "https://babeljs.io/docs/setup/#babel_cli" says to install that locally.
When I installed babel-cli locally and try to compile the script.js file it simply shows
'babel' is not recognized as an internal or external command,
operable program or batch file.
This should answer your question worked for me.
https://github.com/babel/babel/issues/4066
or install babel-cli globally and try it works then.
First Go to main directory or open new terminal
step 1: go to main directory
open terminal or (type cd so that you can directly switch in main directory)
step 2 : npm install -g babel-cli
now successfully install babel cli in your machine
npm install -g babel-cli
It works.