簡體   English   中英

從manbetx客戶端打不開私人倉庫添加cordova插件

[英]Add cordova plugin from GitLab private repo

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

我無法從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:

注意 :我正在使用cordova 7.0.1

我可以看到狀態碼是401。我正在接受密碼提示,以便從私人倉庫中提取信息,但不幸的是,情況並非如此。 有人問過類似的問題 ,但我不想克隆存儲庫並通過本地文件夾添加。 任何幫助將不勝感激。 謝謝 :)

嘗試以下操作,使用最新版本的Cordova從私有GitLab存儲庫添加插件。

cordova plugin add git+ssh://git@gitlab.example.com:<group|user>/<repo>#<branch>

--no-fetch解決方法的問題是...未提取插件。

Cordova問題跟蹤器針對版本7.x和8.x引用了相關的未解決問題:

我發現了兩種解決方法:

  • 克隆存儲庫並添加引用本地路徑的插件(請參閱CB-13507中的注釋
  • 降級到Cordova v6.x以添加您的插件,然后回滾到最新版本

您無需提取此插件。 因此,您需要運行該命令:

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

問候

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM