Darpan Rangari
Darpan Rangari

Reputation: 1570

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

Upvotes: 5

Views: 2291

Answers (1)

Vishnu Mishra
Vishnu Mishra

Reputation: 4029

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

Upvotes: 3

Related Questions