title: How to npm install to only save dependency to package.json?
body: <p>I'm adding dependencies to a <code>package.json</code> that will be used as part of a provisioning process for a virtual machine. As such, I don't actually need to install the modules locally since the provisioner will do that for me inside the VM. So is there any way to do the following:</p>
  
  <pre><code>npm install --save &lt;module&gt;
  </code></pre>
  
  <p>So that it <em>only</em> creates a dependency for the latest version of the module in <code>package.json</code>  without actually downloading the module or creating a <code>node_modules</code> folder?</p>
  
  <p>The <code>--dry-run</code> option is close, as it doesn't create a <code>node_modules</code> folder but it also doesn't write to <code>package.json</code> either.</p>
  
  <p>For now, I'm manually doing the following each time I need to update packages before re-provisioning the VM:</p>
  
  <pre><code>rm -rf node_modules
  </code></pre>
  
  <p>Other reasons for this might include being able to easily build a <code>package.json</code> file in low-bandwidth situations such as tethering, where you know you'll need the module eventually but don't want to spare the bandwidth.</p>