title: npm install failing inside of Docker container
body: <p>I'm trying to get <code>npm install</code> working inside of Docker container(s) on my system...</p>
  
  <p>I've tried the following containers:</p>
  
  <ul>
  <li><code>nikolaik/python-nodejs:python3.8-nodejs12</code></li>
  <li><code>nikolaik/python-nodejs:python3.8-nodejs12-alpine</code></li>
  <li><code>minideb:stretch</code> (installed with nvm)</li>
  </ul>
  
  <p>And they all have the same error. When I try to install an npm package, it will have an error that looks something like this:</p>
  
  <pre class="lang-sh prettyprint-override"><code># npm install -g typescript                                                                                                                                                                                      
  npm ERR! Unexpected end of JSON input while parsing near '...ipt":"next","tsd":"la'                                                                                                                                
  
  npm ERR! A complete log of this run can be found in:                                                                                                                                                               
  npm ERR!     /root/.npm/_logs/2020-04-09T03_42_16_003Z-debug.log
  </code></pre>
  
  <p>If I run something like <code>npm cache clean --force</code>, and run the install command again, it'll fail at some other point in parsing the JSON.</p>
  
  <p>The funny thing is that sometimes if it's a really small package it'll install it without any issues:</p>
  
  <pre class="lang-sh prettyprint-override"><code># npm install padleft                                                                                                                                                                                   [12/1883]
  npm WARN saveError ENOENT: no such file or directory, open '/package.json'
  npm WARN notsup Unsupported engine for padleft@0.2.0: wanted: {"node":"6.3.1","npm":"3.10.6"} (current: {"node":"12.14.1","npm":"6.13.4"})
  npm WARN notsup Not compatible with your version of node/npm: padleft@0.2.0
  npm WARN enoent ENOENT: no such file or directory, open '/package.json'
  npm WARN !invalid#1 No description
  npm WARN !invalid#1 No repository field.
  npm WARN !invalid#1 No README data
  npm WARN !invalid#1 No license field.
  
  + padleft@0.2.0
  added 1 package from 1 contributor and audited 2 packages in 1.472s
  found 0 vulnerabilities
  </code></pre>
  
  <p>It almost seems like it's failing if it can't install something if it doesn't download super fast. I've tried different versions of node/npm with nvm and it all does the same thing. On my host machine, npm works fine. Just having issues within all the Docker containers. I just had it fail with an nvm installed version on another Docker container based on Ubuntu.</p>