title: How to write a package.json file so that all dependencies are downloaded with "npm install"
body: <p>I wrote a simple application using node. It depends on express, mongodb and mongoose (easy).
  So, I created a file called <code>package.json</code> and put this in it:</p>
  
  <pre><code>{
    "name": "booking-dojo",
    "description": "Booking dojo app",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
      "express": "3.x",
      "mongodb": "*",
      "mongoose": "*"
    }
  }
  </code></pre>
  
  <p>I then ran <code>npm install</code>, expecting npm to install those modules <em>and</em> their dependencies.
  The result was disappointing:</p>
  
  <pre><code>booking-dojo@0.0.1 /home/merc/Synced/Development/Bookings/app/server
  ├─┬ express@3.0.0rc3 
  │ ├── commander@0.6.1 
  │ ├─┬ connect@2.4.3 
  │ │ ├── bytes@0.1.0 
  │ │ ├── formidable@1.0.11 
  │ │ ├── pause@0.0.1 
  │ │ └── qs@0.4.2 
  │ ├── cookie@0.0.4 
  │ ├── crc@0.2.0 
  │ ├── debug@0.7.0 
  │ ├── fresh@0.1.0 
  │ ├── methods@0.0.1 
  │ ├── mkdirp@0.3.3 
  │ ├── range-parser@0.0.4 
  │ └─┬ send@0.0.3 
  │   └── mime@1.2.6 
  ├─┬ mongodb@1.1.4 
  │ └── bson@0.1.1 
  └─┬ mongoose@3.0.3 
    ├── hooks@0.2.1 
    └── ms@0.1.0 
  </code></pre>
  
  <p>I am confused by this, as I <em>know</em> that <code>express</code> needs <code>jade</code>  (and much more), and <code>mongoose</code> needs <code>mongodb</code>.<br>
  If I go into <code>node_modules/jade</code> and run <code>npm install</code>, the result from the main tree is very different:</p>
  
  <pre><code>booking-dojo@0.0.1 /home/merc/Synced/Development/Bookings/app/server
  ├─┬ express@3.0.0rc3 
  │ ├── commander@0.6.1 
  │ ├─┬ connect@2.4.3 
  │ │ ├── bytes@0.1.0 
  │ │ ├── formidable@1.0.11 
  │ │ ├── pause@0.0.1 
  │ │ └── qs@0.4.2 
  │ ├─┬ connect-redis@1.4.1 
  │ │ └─┬ redis@0.7.2 
  │ │   └── hiredis@0.1.14 
  │ ├── cookie@0.0.4 
  │ ├── crc@0.2.0 
  │ ├── debug@0.7.0 
  │ ├── ejs@0.8.2 
  │ ├── fresh@0.1.0 
  │ ├── github-flavored-markdown@1.0.1 
  │ ├─┬ hjs@0.0.4 
  │ │ └── hogan.js@2.0.0 
  │ ├─┬ jade@0.27.2 
  │ │ └── mkdirp@0.3.0 
  │ ├── methods@0.0.1 
  │ ├── mkdirp@0.3.3 
  │ ├─┬ mocha@1.4.0
  │ │ ├── diff@1.0.2 
  │ │ ├── growl@1.5.1 
  │ │ └─┬ jade@0.26.3 
  │ │   └── mkdirp@0.3.0 
  │ ├── range-parser@0.0.4 
  │ ├─┬ send@0.0.3 
  │ │ └── mime@1.2.6 
  │ ├── should@1.1.0 
  │ ├─┬ stylus@0.29.0 
  │ │ └── cssom@0.2.5 
  │ └─┬ supertest@0.0.1 
  │   └─┬ superagent@0.5.0 
  │     ├── emitter-component@0.0.1 
  │     ├── formidable@1.0.9 
  │     ├── mime@1.2.5 
  │     └── qs@0.4.2 
  ├─┬ mongodb@1.1.4 
  │ └── bson@0.1.1 
  └─┬ mongoose@3.0.3 
    ├── hooks@0.2.1 
    └── ms@0.1.0 
  </code></pre>
  
  <p>So, <code>express</code> has <em>grown</em> a lot. It looks like <code>npm install</code> is only loading <em>some</em> of the dependencies of the sub-modules.</p>
  
  <p>Can somebody please shed some light on this? Why are some dependencies missing? Am I doing something wrong? (likely)</p>
  
  <p>Thanks!</p>
  
  <p>Merc. </p>