Platform: Linux
When running my node.js program I got the following error
Error: Module version mismatch. Expected 11, got 1.
you might give the error like this:
Error: Module version mismatch. Expected 11, got 1.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/user/node_modules/xml2json/node_modules/node-expat/lib/node-expat.js:4:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
and then, you can notice the error in module or somewhere.
this is because you have updated your node, you might rebuild the module found above.
i revole my question by reinstall(remove, then install) xml2json.
good luck!
Platform: Linux
For future reference in node.js v0.10.x(at least v0.10.0) I got this error:
Error: Module version mismatch. Expected 11, got 1.
To fix this I found this interesting link and also had some help from Ben Noordhuis. The following command helped me get rid of this error:
npm update
This usually happens when you install a package using one version of Node, then change to a different version. This can happen when you update Node, or switch to a different version with nvm.
It can also happen if you're trying to run a process as root with a globally installed Node, but you're running an nvm-managed node within your own user account.
To fix this, you can simply re-install the packages using the correct version of Node. Also ensure that you're using the same version of Node across the different users.
npm rebuild will also do the trick