i use private gitlab, the vue-cli version is 2.8.2
if i clone with project-name like this
vue init -c gitlab.com:username/my-vue-template test
it show err:
vue-cli 路 Failed to download repo vuejs-templates/test: 'git clone' failed with status 128
it seems that the order of argument is wrong
use this cammnd is work fine
vue init -c test gitlab.com:username/my-vue-template
and this
vue-init gitlab.com:username/my-vue-template test
From readme:
If you would like to download from a private repository use the
--cloneflag and the cli will usegit cloneso your SSH keys are used.
@posva thanks for quick prompt
I mean it's should
# yes
vue init --clone my-project username/repo # it's right on my mac
# no
vue init --clone username/repo my-project # vue will treate `my-project` as the repository addr
or it's just the bug of my commander module
I see the bug, I'll fix it
I gave it a look but I don't understand why the order is being messed up when loading the args. Can you take a quick look @egoist , please?
BTW, using the option at the end works as expected
Not sure if this helps, but this appears to work (just replace vue init with vue-init):
vue-init -c gitlab:user/repo my-project
Im having a similar kind of issue with the custom template and its hosted in my work's private bitbucket repo and get the following error:
vue-cli 路 Failed to download repo ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git: 'git clone' failed with status 128
I tried all the mentioned steps:
vue init -c ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git yay
vue init ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git --clone yay
When I put in on a public Github repo it works fine but not sure why its not working with the private bitbucket repo?
When I do git clone bitbucket of the exact repo it works fine as so I can tell its not the connection issue with SSH.
git clone ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git
Any help would be highly appreciated. Thanks.
@bajras did you try replacing vue init with vue-init?
@mrcsmcln yes, that didnt work either.
me too, In Window OS. I pull a request fix the bug.
````
vue-init -c gitlab:gitlab.host:user/repo project-name
````
commander appears to be switching the order of the args.
vue init a b
Program.args[0] === a
Program.args[1] === b
vue init -c a b
Program.args[0] === b
Program.args[1] === a
Perhaps an iterating through an object with no guarantee of order.
Running
vue init --clone a b
Causes Commander.prototype.parse to be run twice. First for 'vue' which results in '--clone a' being seen as an unknown parameter. The unknown parameters are then tacked back on in Commander.prototype.parseArgs.
Personally, I'd see this as a bug in Commander which could do better with named arguments. That said --clone is not a named argument, it is being used as a switch and Commander does not seem to support argumentless switches.
It is perhaps less confusing to suggest users use the following command
vue init --clone=true a b
I pull a request fix the bug
# There will be errors in the windows
vue init gitlab:http://192.168.1.125:nodejser/templates my-project
@bajras Did u manage to solve this? Installing templates from your works private repo?
Has this been fixed on OSX? I see that it was closed on Aug 18th, and reopened for window's OS.
Unfortunately I can't get this to work either. I've tried all options mentioned in this thread.
I have not been able to get it work. Had to clone the repo first locally and then do the init.
@bajras I got the same problem! After format the git repo url, it works. Vue-init get template from remote repo with download-git-repo which check your url format. So, just run:
vue-init -c <host>:<userName>/<repo> <projectName>
Do not add 'ssh://git@' prefix and '.git' suffix. In your case:
vue-init -c bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate yay
Try it.
Same error:
'git clone' failed with status 128
Most helpful comment
@bajras I got the same problem! After format the git repo url, it works. Vue-init get template from remote repo with download-git-repo which check your url format. So, just run:
vue-init -c <host>:<userName>/<repo> <projectName>Do not add 'ssh://git@' prefix and '.git' suffix. In your case:
vue-init -c bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate yayTry it.