title: npm install throws npm ERR! Cannot read property '0' of undefined
body: <p>I upgraded node to 8.6.4 - after I did that I got the error. So I switched back to 8.6.0 using <a href="https://github.com/creationix/nvm" rel="nofollow noreferrer">NVM</a>. This was in attempt to solve another problem I'm having which can be seen here: <a href="https://stackoverflow.com/questions/47927707/dyld-symbol-not-found-jni-createjavavm">dyld: Symbol not found: _JNI_CreateJavaVM</a></p>
  
  <p>This is my full stack trace below:</p>
  
  <blockquote>
    <p>macbook-pro:project-dir kawnah$ npm i WARN registry
    Unexpected warning for <a href="https://registry.npmjs.org/" rel="nofollow noreferrer">https://registry.npmjs.org/</a>: Miscellaneous
    Warning EINTEGRITY:
    sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==
    integrity checksum failed when using sha512: wanted
    sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==
    but got sha1-wSYRB66y8pTr/+ye2eytUppgl+0=. (8793 bytes) WARN registry
    Using stale package data from <a href="https://registry.npmjs.org/" rel="nofollow noreferrer">https://registry.npmjs.org/</a> due to a
    request error during revalidation. WARN registry Unexpected warning
    for <a href="https://registry.npmjs.org/" rel="nofollow noreferrer">https://registry.npmjs.org/</a>: Miscellaneous Warning EINTEGRITY:
    sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
    integrity checksum failed when using sha512: wanted
    sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
    but got sha1-76ouqdqg16suoTqXsritUf776L4=. (2394 bytes) WARN registry
    Using stale package data from <a href="https://registry.npmjs.org/" rel="nofollow noreferrer">https://registry.npmjs.org/</a> due to a
    request error during revalidation. npm WARN babel-loader@6.4.1
    requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none
    is installed. You must install peer dependencies yourself.</p>
    
    <p>npm ERR! Cannot read property '0' of undefined</p>
    
    <p>npm ERR! A complete log of this run can be found in: npm ERR!<br>
    /Users/kawnah/.npm/_logs/2018-01-04T19_46_31_194Z-debug.log</p>
  </blockquote>
  
  <p>This github thread: <a href="https://github.com/npm/npm/issues/17858" rel="nofollow noreferrer">https://github.com/npm/npm/issues/17858</a> suggests it's just a bug with NPM itself. That's not my problem, as it was working perfectly fine. </p>
  
  <p>How do I resolve this?</p>
  
  <p>EDIT: Upon further inspection, all my node modules installed successfully. But that still doesn't tell me what the error means?</p>