不能在centos 6.5 64bit上用npm安装node-xmpp-client

在节点0.10.30中安装node-xmpp-client时,我总是得到这个“gyp ERR!stack Error:spawn EACCES”

gyp ERR! configure error gyp ERR! stack Error: spawn EACCES gyp ERR! stack at errnoException (child_process.js:1001:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:792:34) gyp ERR! System Linux 2.6.32-504.3.3.el6.x86_64 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/ltx/node_modules/node-expat gyp ERR! node -v v0.10.30 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /usr/local/lib/node_modules/npm-debug.log npm ERR! not ok code 0 

最后一行是npm-debug.log

 3444 verbose lock tar:///root/.npm/async/0.9.0/package.tgz /root/.npm/3975aa3c-root-npm-async-0-9-0-package-tgz.lock 3445 error Error: ENOENT, chown '/usr/local/lib/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/ltx/node_modules/sax/LICENSE' 3446 error If you need help, you may report this *entire* log, 3446 error including the npm and node versions, at: 3446 error <http://github.com/npm/npm/issues> 3447 error System Linux 2.6.32-504.3.3.el6.x86_64 3448 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-xmpp-client" "-g" 3449 error cwd /usr/local/lib/node_modules 3450 error node -v v0.10.30 3451 error npm -v 1.4.21 3452 error path /usr/local/lib/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/ltx/node_modules/sax/LICENSE 3453 error fstream_path /usr/local/lib/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/ltx/node_modules/sax/LICENSE 3454 error fstream_type File 3455 error fstream_class FileWriter 3456 error fstream_finish_call chown 3457 error code ENOENT 3458 error errno 34 3459 error fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19 3459 error fstream_stack /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:143:7 3459 error fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15) 3460 verbose exit [ 34, true ] 

npm cache clean我得到了相同的gyp重build错误,并在npm-debug.log最后一行是:

 2138 info preuninstall node-xmpp-client@1.0.0-alpha19 2139 info uninstall node-xmpp-client@1.0.0-alpha19 2140 verbose true,/usr/local/lib/node_modules,/usr/local/lib/node_modules unbuild node-xmpp-client@1.0.0-alpha19 2141 info postuninstall node-xmpp-client@1.0.0-alpha19 2142 error node-stringprep@0.5.4 install: `node-gyp rebuild` 2142 error Exit status 1 2143 error Failed at the node-stringprep@0.5.4 install script. 2143 error This is most likely a problem with the node-stringprep package, 2143 error not with npm itself. 2143 error Tell the author that this fails on your system: 2143 error node-gyp rebuild 2143 error You can get their info via: 2143 error npm owner ls node-stringprep 2143 error There is likely additional logging output above. 2144 error System Linux 2.6.32-504.3.3.el6.x86_64 2145 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-xmpp-client" "-g" 2146 error cwd /usr/local/lib/node_modules 2147 error node -v v0.10.30 2148 error npm -v 1.4.21 2149 error code ELIFECYCLE 2150 verbose exit [ 1, true ] 

安装的Python版本是2.7.6

我发现这个问题:在这里的状态: http ://node-xmpp.github.io/doc/nodestringprep.html所有我必须insall是:

 yum install libicu-devel 

之后,因为尝试安装node-xmpp-client,我得到了一些

 npm ERR! EEXIST, mkdir 

修正如下所述:通过删除〜/ .npmrc, NPM不会运行,因为EEXIST错误