2017-09-06 28 views
0
cordova plugin add http://gitlab.com/<user>/<private-repo>.git 

我无法从GitLab中的私人回购添加cordova插件。当我运行上面的命令,它抛出我下面的错误:从GitLab私人回购添加cordova插件

Error: Failed to fetch plugin http://gitlab.com/<user>/<private-repo>.git via registry. 
    Probably this is either a connection problem, or plugin spec is incorrect. 
    Check your connection and plugin name/version/URL. 
    Error: npm: Command failed with exit code 1 Error output: 
    npm ERR! fetch failed http://gitlab.com/<user>/<private-repo>.git 
    npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401 
    npm ERR! fetch failed http://gitlab.com/<user>/<private-repo>.git 
    npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401 
    npm ERR! fetch failed http://gitlab.com/<user>/<private-repo>.git 
    npm ERR! Darwin 16.7.0 
    npm ERR! argv "~/.nvm/versions/node/v6.4.0/bin/node" 
    "~/.nvm/versions/node/v6.4.0/bin/npm" "install" 
    "http://gitlab.com/<user>/<private-repo>.git" "--save" 
    npm ERR! node v6.4.0 
    npm ERR! npm v3.10.3 

    npm ERR! fetch failed with status code 401 
    npm ERR! 
    npm ERR! If you need help, you may report this error at: 
    npm ERR!  <https://github.com/npm/npm/issues> 

    npm ERR! Please include the following file with any support request: 

注意:我使用的科尔多瓦7.0.1

我可以看到状态码401我接受密码提示从私人回购获取,但不幸的是,情况并非如此。 similar question被问到,但我不想克隆回购,并通过本地文件夹添加。任何形式的帮助将不胜感激。谢谢:)

回答

0

你需要不要取这个插件。所以,你需要运行命令:

sudo cordova plugin add http://gitlab.com/<user>/<private-repo>.git --save --nofetch 

问候

+0

我试过这个,但它不起作用。谢谢回答。 –

+0

mmmmm ....那么你的日志说什么? –

+0

它抛出上面发布相同的错误。 –

0

请尝试以下方法从使用最新版本的科尔多瓦私人GitLab库添加一个插件。

cordova plugin add git+ssh://[email protected]:<group|user>/<repo>#<branch>