title: Multiple NPM and NodeJS versions causing SSL/Certificate issues installing PM2 Profiler
body: <p><em>I've worked this out myself but didn't find much help from other answers from around the net, so I thought I'd post my answer here for anyone else that might have the same problem.</em></p>
  
  <p>Trying to install the PM2 profiler to work out what is causing a memory leak in a NodeJS application, but during installation I'm getting the following error:</p>
  
  <pre><code>$ pm2 install profiler
  [PM2][Module] Installing module profiler
  [PM2][Module] Calling [NPM] to install v8-profiler-node8 ...
  npm ERR! Error: CERT_UNTRUSTED
  npm ERR!     at SecurePair.&lt;anonymous&gt; (tls.js:1430:32)
  npm ERR!     at SecurePair.emit (events.js:92:17)
  npm ERR!     at SecurePair.maybeInitFinished (tls.js:1029:10)
  npm ERR!     at CleartextStream.read [as _read] (tls.js:521:13)
  npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:341:10)
  npm ERR!     at EncryptedStream.write [as _write] (tls.js:418:25)
  npm ERR!     at doWrite (_stream_writable.js:226:10)
  npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
  npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
  npm ERR!     at write (_stream_readable.js:602:24)
  npm ERR! If you need help, you may report this log at:
  npm ERR!     &lt;http://github.com/isaacs/npm/issues&gt;
  npm ERR! or email it to:
  npm ERR!     &lt;npm-@googlegroups.com&gt;
  
  npm ERR! System Linux 2.6.32-696.20.1.el6.x86_64
  npm ERR! command "node" "/usr/bin/npm" "install" "v8-profiler-node8" "--loglevel=error"
  npm ERR! cwd /usr/lib/node_modules/pm2
  npm ERR! node -v v0.10.48
  npm ERR! npm -v 1.3.6
  npm ERR!
  npm ERR! Additional logging details can be found in:
  npm ERR!     /usr/lib/node_modules/pm2/npm-debug.log
  npm ERR! not ok code 0
  [PM2][Module][ERROR] Profiling installation has FAILED (checkout previous logs)
  [PM2][ERROR] Module install failed
  </code></pre>
  
  <p>Lots of posts around the internet suggest changing NPM settings to ignore the certificates or ignore https but this hasn't helped:</p>
  
  <p><a href="https://stackoverflow.com/a/45884819/884842">https://stackoverflow.com/a/45884819/884842</a>
  <a href="https://github.com/nodejs/node/issues/3742#issuecomment-155545828" rel="nofollow noreferrer">https://github.com/nodejs/node/issues/3742#issuecomment-155545828</a></p>
  
  <p>This is on a server running CentOS 6.10</p>