2017-09-06 68 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>