在窗口上安装node-xmpp 7

我在Windows 7上安装了node --version v0.8.22 。我试图用命令npm install node-xmpp 。 我用npm install安装了express,log4js和socket.io,但是node-xmpp引发了下面的错误。

 786 info preuninstall node-xmpp@0.3.2 787 info uninstall node-xmpp@0.3.2 788 verbose true,C:\www\resume-bootstrap\src\node_modules,C:\www\resume-bootstrap\src\node_modules unbuild node-xmpp@0.3.2 789 info postuninstall node-xmpp@0.3.2 790 error node-expat@2.0.0 install: `node-gyp rebuild` 790 error `cmd "/c" "node-gyp rebuild"` failed with 1 791 error Failed at the node-expat@2.0.0 install script. 791 error This is most likely a problem with the node-expat package, 791 error not with npm itself. 791 error Tell the author that this fails on your system: 791 error node-gyp rebuild 791 error You can get their info via: 791 error npm owner ls node-expat 791 error There is likely additional logging output above. 792 error System Windows_NT 6.1.7601 793 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-xmpp" 794 error cwd C:\www\resume-bootstrap\src 795 error node -v v0.8.22 796 error npm -v 1.2.14 797 error code ELIFECYCLE 798 verbose exit [ 1, true ] 

任何想法是什么意思?

谢谢!

您需要确保您已经安装了先决条件。 查看https://github.com/TooTallNate/node-gyp的安装说明

由于他们有点混乱,我会在这里再次列出他们:

  1. 卸载已安装的任何Microsoft Visual C ++ 2010 Redistributable。
  2. 安装Python 2.7.3
  3. 安装Microsoft Visual Studio C ++ 2010(Express)
  4. 安装Windows 7 64位SDK
  5. 安装Windows SDK 7.1的编译器更新
  6. 安装Microsoft Visual Studio C ++ 2012 for Windows Desktop(Express)
  7. http://sourceforge.net/projects/expat/安装libexpat

这在64位Win7上完美的工作。 如果您使用32位版本,则跳过点4和5。

我希望这能解决你的问题。