【问题标题】:Can't install node-xmpp-client with npm on centos 6.5 64bit无法在 centos 6.5 64bit 上使用 npm 安装 node-xmpp-client
【发布时间】:2015-03-05 21:48:09
【问题描述】:

在节点 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 重建错误,在 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

【问题讨论】:

  • 您能否提供日志文件中的详细信息 (/usr/local/lib/node_modules/npm-debug.log)。
  • 看起来像是模块试图安装的文件夹的权限问题,或者可能是节点本身的权限;你能显示他们的权限级别吗?
  • 我是root用户。是这个问题吗?
  • 对我来说似乎是这个错误:stackoverflow.com/questions/17990647/… 所以也许清理缓存可以解决问题:npm cache clean
  • npm cache clean 没有解决问题

标签: node.js


【解决方案1】:

我发现了问题: 正如这里所说:http://node-xmpp.github.io/doc/nodestringprep.html 我只需要安装:

yum install libicu-devel

之后,由于尝试安装 node-xmpp-client 失败,我得到了一些

npm ERR! EEXIST, mkdir

已按此处所述修复:NPM wont run due to EEXIST error 通过删除 ~/.npmrc

【讨论】:

    猜你喜欢
    • 2014-06-25
    • 2016-09-17
    • 2014-11-15
    • 2016-10-15
    • 2016-08-20
    • 2014-10-27
    • 2015-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多