title: How to easily verify correct npm dependencies installed?
body: <p>How can I know when to prompt user to run <code>npm install</code> if there are any unmet package.json dependencies?</p>
  
  <p>I would like to do this, because if any <code>require()</code> fails, the user gets a poor error message:</p>
  
  <pre><code>module.js:340
      throw err;
            ^
  Error: Cannot find module 'nopt'
  </code></pre>
  
  <p>I've previously tried to just check for the existence of a <code>node_modules</code> directory, but this only works effectively for fresh git clones.  I've also tried just requiring <code>npm</code> and running <code>npm install</code> as part of load, but that is very heavy weight.</p>
  
  <p>I'm hoping there is a lighter weight library out there that just parses <code>package.json</code> and makes sure <code>node_modules</code> contents satisfy the requirements.</p>
  
  <p>One idea was to use <code>process.on('uncaughtException')</code> to catch only module import errors, but looking to see if there is a "standard" solution first.</p>