title: Updating all packages with Npm
body: <p>I have a fairly large number of packages that are outdated and I want to update. I tried running npm update as described in the <a href="https://docs.npmjs.com/cli/update#description" rel="nofollow noreferrer">npm documentation</a>: <code>npm update --depth 9999 -dev</code>
  The update took a long time and at the end it failed. I tried a few more time, I set the stack size to unlimited, etc, but it always takes hours and at the end it fails. </p>
  
  <p>I tried updating a single package with --depth 999 (not 9999) and that failed as well. </p>
  
  <p>Is there any recommended way how to update all packages that works?</p>
  
  <pre><code>**Edit:** At first I was getting  `MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit`
  </code></pre>
  
  <p>Then I got a heap exceeded exception:</p>
  
  <pre><code>FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
  </code></pre>
  
  <p>And finally, I got <code>Max call stack size exceeded.</code></p>
  
  <p>I set the stack size to unlimited and lowered the depth, but it's been running for hours with no result.</p>