2016-11-18 76 views
1

我可以成功你能從團隊服務git回購`npm安裝嗎?

git clone https://[org].visualstudio.com/_git/[repo] 

,但如果我跑

npm install https://[org].visualstudio.com/_git/[repo] --save 

我得到

npm ERR! fetch failed https://[org].visualstudio.com/_git/[repo] 
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 203 

是否有可能從團隊服務的git回購安裝NPM包,比如你從GitHub可以嗎?

回答

4

如果你想從你需要如下構建的URL特定的Git回購安裝包,注意URL與git+https://

npm i --save git+https://[org].visualstudio.com/_git/[repo]

這個前綴,如果你也想將工作安裝您的回購協議通過ssh

npm i --save git+ssh://[email protected]:<owner>/<repo>

您可以添加這些式回購的URL到您的package.json的依賴以及

"dependencies": { 
    "custom-pkg": "git+https://[org].visualstudio.com/_git/[repo]" 
} 

你可以閱讀更多有關不同的方式,直接從混帳與NPM在npm install docs

安裝
相關問題