当我们进行npm install时,如何在node_modules中克隆git存储库?

时间:2017-01-10 13:55:23

标签: node.js npm package.json

当我们在npm中安装依赖项时,我们如何克隆git存储库。

"dependencies": {
    "<Mydependency>": "<some git url>",
    "promise": "^7.0.3",
    "react": "^0.14.8",
    "react-addons-pure-render-mixin": "^0.14.0",
    "react-dom": "^0.14.8",
    "react-mixin": "^2.0.2"
  },

1 个答案:

答案 0 :(得分:3)

使用此: 在package.json

没有密码:

"Mydependency": "git+https://<somegiturl.git>#<branch>"

密码:

 "Mydependency": "git+https://<userName>:<password>@bitbucket.org/myrepo.git#<branch>"