title: Upgrading from node 8 to node 10: error regarding "module compiled against a different Node.js version"
body: <p>I am now getting the following error when I run my node app.  It has only occurred after I upgraded from <code>node 8.12.0</code> to <code>node 10.13.0</code> (which is now "<a href="https://nodejs.org/en/" rel="nofollow noreferrer">recommended for most users</a>").  The problem seems to relate to <a href="https://www.npmjs.com/package/node-expat" rel="nofollow noreferrer">node-expat</a>, which I don't use directly but which is a dependency of <a href="https://www.npmjs.com/package/xml2json" rel="nofollow noreferrer">xml2json</a> (which I <em>do</em> use directly).  </p>
  
  <pre><code>/root/workspace/myapp/node_modules/bindings/bindings.js:88
          throw e
          ^
  
  Error: The module '/root/workspace/myapp/node_modules/node-expat/build/Release/node_expat.node'
  was compiled against a different Node.js version using
  NODE_MODULE_VERSION 64. This version of Node.js requires
  NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
  the module (for instance, using `npm rebuild` or `npm install`).
      at Object.Module._extensions..node (module.js:682:18)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
      at Module.require (module.js:597:17)
      at require (internal/module.js:11:18)
      at bindings (/root/workspace/myapp/node_modules/bindings/bindings.js:81:44)
      at Object.&lt;anonymous&gt; (/root/workspace/myapp/node_modules/node-expat/lib/node-expat.js:4:32)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
  </code></pre>
  
  <p>What do I need to do to fix this?  Yes, I have completely removed <code>node_modules</code> and done <code>npm install</code> as per <a href="https://stackoverflow.com/questions/46384591/node-was-compiled-against-a-different-node-js-version-using-node-module-versio">this thread</a>... doesn't help.</p>