I am now getting the following error when I run my node app. It has only occurred after I upgraded from node 8.12.0
to node 10.13.0
(which is now "recommended for most users"). The problem seems to relate to node-expat, which I don't use directly but which is a dependency of xml2json (which I do use directly).
/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.<anonymous> (/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)
What do I need to do to fix this? Yes, I have completely removed node_modules
and done npm install
as per this thread... doesn't help.