title: When installing a package with NPM, can you tell it to use a different version of one of its dependencies?
body: <p>Say you want to install a library <code>lib-a</code> which has dependencies <code>dep-1</code> and <code>dep-2</code>. If <code>lib-a</code> has declared in its package.json to use a version of <code>dep-2</code> that is out of date (say it doesn't work on node 0.8.0 which just came out), but there is a branch of <code>dep-2</code> that works with node 0.8.0 - branch name <code>node0.8.0</code>.</p>
  
  <p>So the packages in the equation are:</p>
  
  <pre><code>git://github.com/user-a/lib-a
  git://github.com/user-b/dep-1
  git://github.com/user-c/dep-2
  git://github.com/user-c/dep-2#node0.8.0
  </code></pre>
  
  <p>Is there a way to tell NPM to install <code>lib-a</code>, but use <code>dep-2#node0.8.0</code> instead of <code>dep-2</code>?</p>
  
  <p>With NPM you can install a specific branch of a project like this:</p>
  
  <pre><code>npm install git://github.com/user-c/dep-2#node0.8.0
  </code></pre>
  
  <p>And if I were to customize the package.json of <code>lib-a</code>, you could tell it to use <code>dep-2#node0.8.0</code> like this:</p>
  
  <pre><code>{
    "name": "lib-a",
    "dependencies": {
      "dep-1": "&gt;= 1.5.0",
      "dep-2": "git://github.com/user-c/dep-2#node0.8.0"
    }
  }
  </code></pre>
  
  <p>By modifying the package.json you can then run</p>
  
  <pre><code>npm install lib-a
  </code></pre>
  
  <p>and it will install the node 0.8.0 compatible <code>dep-2</code> branch. But, that requires I have access to modifying <code>lib-a</code>, which for my specific case I don't. Technically, I could fork <code>lib-a</code> and make the above change to package.json. But in my specific case, <code>lib-a</code> is a dependency of <em>another</em> library, so I'd have to fork the project it's referenced in, and on and on...</p>
  
  <p>So the question is, is there a way to tell NPM to install <code>lib-a</code>, and tell it to use the <code>node0.8.0</code> branch of <code>dep-2</code>? Something like this:</p>
  
  <pre><code>npm install lib-a --overrides dep-2:git://github.com/user-c/dep-2#node0.8.0
  </code></pre>
  
  <p>That would be awesome. If it's not possible, that would be good to know so I can prepare myself to have to fork/customize the chain of projects.</p>