NPM - How do I override one of my dependencies dependency? : <p>Recently, npm released the <a href="https://docs.npmjs.com/getting-started/running-a-security-audit" rel="noreferrer">npm audit</a> command. It runs automatically when you <code>npm i</code> letting you know of any vulnerabilities. I have a simple dependency tree, something like this:</p>

<pre><code>package A
package B
  package B dependency
package C
</code></pre>

<p>My <code>package.json</code> includes A, B, and C in the <code>dependencies</code> field. B is requiring its own dependency, which npm warns has vulnerabilities. My question is, how can I override the <code>package B dependency</code> version so as to use the latest version?  I've read around that this is either the job for <code>shrinkwrap.json</code> or manually editing <code>package-lock.json</code> but I can't find any concrete examples showing how to do it.</p>

<p>I <em>did</em> see that Yarn supports a <code>resolutions</code> field in <code>package.json</code>, but I'm not using Yarn. Is there a way to accomplish this with npm out of the box?</p>
