title: npm install: Verfication failed while extracting
body: <p><strong>READ BEFORE ANSWER:</strong> I've already solved this issue. It was a caching issue on the npm servers. Everything works fine after switching to GitHub packages. I've already accepted <a href="https://stackoverflow.com/a/59650092/6523216">my own answer</a>.</p>
  <hr />
  <hr />
  <hr />
  <p>I have a project, which I want to deploy to elastic beanstalk but sometimes the deploy fails on the npm install script with the following message:</p>
  <pre class="lang-none prettyprint-override"><code>npm ERR! code EINTEGRITY
  npm ERR! Verification failed while extracting @my-package@^1.2.0:
  npm ERR! Verification failed while extracting @my-package@^1.2.0:
  npm ERR! sha512-lQ...HA== integrity checksum failed when using sha512: wanted sha512-lQ...HA== but got sha512-nH...ow==. (4835509 bytes)
  </code></pre>
  <p>It fails even on packages which are severel weeks old.</p>
  <p>I’ve tried:</p>
  <ul>
  <li><p><code>npm cache clean --force</code></p>
  </li>
  <li><p><code>npm cache verify</code></p>
  </li>
  <li><p><code>node_modules</code> is in <code>.npmignore</code></p>
  </li>
  <li><p><code>package-lock.json</code> is in <code>.npmignore</code></p>
  </li>
  <li><p>Writing a mail to support@npmjs.com, but they replying always with some helpless default replies without any solution or intention to help.</p>
  </li>
  </ul>
  <p>It fails even on new elastic beanstalk instances.</p>
  <p>I have no idea how to solve this problem.</p>
  <p><strong>EDIT:</strong> I've also tried to delete the npm cache while preinstall script, but it doesn't work either.</p>
  <p><strong>EDIT2:</strong> My repo has no <code>package-lock.json</code>.</p>
  <p><strong>EDIT3:</strong> My <code>.npmrc</code> file has the following content</p>
  <pre><code>      //registry.npmjs.org/:_authToken=${NPM_TOKEN}
        unsafe-perm=true
        package-lock=false
        strict-ssl=false
  </code></pre>
  <p><strong>EDIT4:</strong> I think it wasn't clear: It's a private package on the official npm registry. And it doesn't fail always. The current publish process includes several attempts to deploy on aws instance so long as it's succeed.</p>