Reputation: 21
I usually perform fresh re-installs of packages after a period of non-use, but when I came to perform a fresh install of Vue.js and vue-cli I tried to perform a vue init
on a new project but was told that vue was not recognised as an operable or batch file etc.
It is possible that I created a problem when I uninstalled vue-cli, which removed something like 250 packages. Subsequent reinstall only installed 1 package, but I was then unable to get any response from the vue init
command other than the above.
I have tried every workaround I could find on SO and elsewhere which boils down to the following: -
One consistent error message in my attempts to perform npm install vue
was that I lacked a package.json
file in my C:/Users/user
folder (I am said user
and I have administrator privileges). I ran npm init
to create a blank package.json file in that folder but that didn't work either.
The root problem seems to be that nothing I do re-installs a vue.cmd
file in my AppData/Roaming/npm
folder, even though this path is properly installed in my environment variables. I have looked if this file has been installed elsewhere on my machine, but it hasn't.
Is it possible to manually download a vue.cmd file and put it exactly where it needs to sit, i.e. in my AppData/Roaming/npm
folder? I googled this to no avail. All this is while running Command Prompt as an administrator.
Is anyone else having this problem? Is there something with another JS framework which is currently blocking Vue from being properly installed? (I have also developed projects in React and Angular5.)
Just as an update, this is the package.json
file I currently have in my C:/Users/user
folder after running npm init
from that folder: -
{
"name": "user",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"npm": "^5.8.0",
"vue": "^2.5.16"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Upvotes: 2
Views: 608
Reputation: 1019
It sounds like you don't have vue-cli
installed on your machine
But without any error messages it's impossible to tell.
try npm install -g [email protected]
then run which vue-cli
to check the location
Upvotes: 1