我正在尝试使用npm在我的Windows系统上安装node-xmpp-core
。
(我曾尝试使用cygwin,但是在配置时,node-gyp不会干净地退出。)
我正在使用标准的Windows cmd提示符。我的命令是:
> npm install node-xmpp-core --msvs_version=2013
我得到的错误是“.. \ node-stringprep.cc(2):致命错误C1083:无法打开包含文件:'unicode / unistr.h':没有这样的文件或目录”。 (下面的完整输出。)
由于我知道编译器必须查找此文件,因此我下载了ICU库并设置了INCLUDE环境变量:
> set INCLUDE
INCLUDE="C:\Program Files (x86)\icu\include"
发生了什么事?
我从多个网络搜索中了解到,在SO和其他地方,Windows上涉及node-gyp的所有内容都可能很脆弱。但这似乎是如此基本。
完整的gyp输出(也有基本的npm输出):
> node-stringprep@0.5.4 install C:\Users\jgruenhu\My Documents\code\centenario\jxgProj\node_modules\node-xmpp-core\node_modules\node-stringprep
> node-gyp rebuild
C:\Users\jgruenhu\My Documents\code\centenario\jxgProj\node_modules\node-xmpp-core\node_modules\node-stringprep>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
node-stringprep.cc
..\node-stringprep.cc(2): fatal error C1083: Cannot open include file: 'unicode/unistr.h': No such file or directory [C:\Users\jgruenhu\My Documents\code\centenario\jxgProj\node_modules\node-xmpp-core\node_modules\node-stringprep\build\node_stringprep.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jgruenhu\My Documents\code\centenario\jxgProj\node_modules\node-xmpp-core\node_modules\node-stringprep
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! node-stringprep@0.5.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-stringprep@0.5.4 install script.
npm ERR! This is most likely a problem with the node-stringprep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-stringprep
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-xmpp-core" "--msvs_version=2013"
npm ERR! cwd C:\Users\jgruenhu\My Documents\code\centenario\jxgProj
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\jgruenhu\My Documents\code\centenario\jxgProj\npm-debug.log
npm ERR! not ok code 0