简体   繁体   English

在ubuntu或centos上安装node-expat

[英]Install node-expat on ubuntu or centos

I'm trying to install node-expat . 我正在尝试安装node-expat I've tried everything suggested that I could find. 我尝试了所有可以找到的建议。 I don't get any build errors while running npm install node-expat . 我在运行npm install node-expat时没有任何构建错误。 I've put in all the dependencies & building kits, tried npm cache clean & tried it on both CentOS (Amazon Linux) and Ubuntu 12.10 but the error remains the same: 我已经放入了所有依赖项和构建套件,尝试了npm cache clean并在CentOS(Amazon Linux)和Ubuntu 12.10上都进行了尝试,但是错误仍然相同:

module.js:485
  process.dlopen(filename, module.exports);
          ^
Error: Module version mismatch, refusing to load.
    at Object.Module._extensions..node (module.js:485:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/ubuntu/cc/node_modules/node-expat/lib/node-expat.js:4:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

How can I get it to run without hitches? 如何使它顺利运行?

The reason I want node-expat is for node-xmpp 我想要node-expat的原因是针对node-xmpp

This may or may not help you, but I was getting the same error with an appjs app I'm working on, and I just figured out what was causing it for me. 这可能对您有帮助,但可能无济于事,但是我正在使用的appjs应用程序遇到相同的错误,我只是想出是什么原因造成的。 I have node v0.10.x installed on my machine, but I was building the modules to include them in an appjs app (which currently comes packaged with v0.8.x of node.exe. So I was building the module with 0.10, but trying to run it on 0.8. 我的机器上安装了节点v0.10.x,但是我正在构建模块以将其包含在appjs应用程序中(该应用程序当前与node.exe v0.8.x一起打包。因此,我使用0.10构建模块,但尝试在0.8上运行它。

I uninstalled my node 0.10, installed 0.8, rebuilt/installed the offending module into my appjs app, and the error went away. 我卸载了节点0.10,安装了0.8,将有问题的模块重建/安装到了我的appjs应用中,错误消失了。 So make sure you're building the module with the same version of node you're trying to run it on! 因此,请确保您要使用要在其上运行该模块的相同版本的节点来构建该模块!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM