title: Node.js npm install express error fetch failed
body: <p>npm install express results in the following error</p>
  
  <pre><code>$ npm install express
  npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
  npm ERR! fetch failed https://registry.npmjs.org/etag/-/etag-1.5.1.tgz
  npm ERR! fetch failed https://registry.npmjs.org/methods/-/methods-1.1.0.tgz
  npm ERR! fetch failed https://registry.npmjs.org/on-finished/-/on-finished-2.1.1.tgz
  npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
  npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
  npm ERR! Error: Hostname/IP doesn't match certificate's altnames
  npm ERR!     at SecurePair.&lt;anonymous&gt; (tls.js:1389:23)
  npm ERR!     at SecurePair.emit (events.js:92:17)
  npm ERR!     at SecurePair.maybeInitFinished (tls.js:979:10)
  npm ERR!     at CleartextStream.read [as _read] (tls.js:471:13)
  npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:340:10)
  npm ERR!     at EncryptedStream.write [as _write] (tls.js:368:25)
  npm ERR!     at doWrite (_stream_writable.js:225:10)
  npm ERR!     at writeOrBuffer (_stream_writable.js:215:5)
  npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:182:11)
  npm ERR!     at write (_stream_readable.js:601:24)
  npm ERR!     at flow (_stream_readable.js:610:7)
  npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:642:5)
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     &lt;http://github.com/npm/npm/issues&gt;
  
  npm ERR! System Linux 3.14.13-c9
  npm ERR! command "/home/ubuntu/.nvm/v0.10.33/bin/node" "/home/ubuntu/.nvm/v0.10.33/bin/npm" "install" "express"
  npm ERR! cwd /home/ubuntu/workspace
  npm ERR! node -v v0.10.33
  npm ERR! npm -v 1.4.28
  npm ERR! not ok code 0
  </code></pre>
  
  <p>How to resolve this? There are already many duplicates of this question with INCORRECT answers, I'm sharing this with the below CORRECT answer to clear things up.</p>