简体   繁体   中英

How can we clone a git repository in node_modules when we do npm install?

How can we clone a git repository when we install our dependency in npm.

"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"
  },

Use this: in the package.json

Without password:

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

with password:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM