2016-11-18 72 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

安装
相关问题