我想实现一个bosh服务器。由于在Windows平台上很难,我决定通过VMware将它部署在Ubuntu虚拟机上。我安装没有问题。我在这个页面上看到了这个过程:http://code.google.com/p/node-xmpp-bosh/wiki/DebianHowTo。 现在我想在控制台上使用命令sudo bosh
或sudo /etc/init.d/bosh start
来测试我的波什服务器。我有Starting bosh server.
没有结果。ubuntu上的node-xmpp-bosh错误
我看看bosh.err
文件,我看到exec: 2: /usr/local/lib/bosh/run-server.js: Permission denied
我不知道为什么这个错误与sudo
。
我给了可执行权限,如dhruvbird说:chmod +x /usr/local/lib/bosh/run-server.js
。
现在,当我执行命令sudo bosh
我Starting bosh
在终端上和bosh.err
有这样的:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'ltx'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/usr/local/lib/bosh/src/bosh.js:26:19)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)̍
当我执行命令sudo /etc/init.d/bosh start
我总是有Starting bosh
在终端上,这对bosh.err
:
/usr/bin/env: node: No such file or directory
而我的波什服务器无法正常工作。
我跑dpkg -L nodejs | grep bin
或dpkg -L node | grep bin
,我可以读取包未安装每个测试。我运行了apt-get update && apt-get install -u nodejs
和apt-get update && apt-get install -u node
,结果始终如此。当我运行node -v
并有v0.6.3
,我想这意味着该节点是安装。我有home/node
上的节点目录。这是路径问题吗?
我尝试运行npm install node-xmpp-bosh
,这是NPM-的的debug.log结果:
...
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ true,
verbose unbuild [email protected] '/home/frederic/node_modules',
verbose unbuild [email protected] '/home/frederic/node_modules' ]
verbose binRoot [ '/home/frederic/node_modules/.bin',
verbose binRoot { 'bosh-server': './run-server.js' } ]
info postuninstall [email protected]
ERR! Error: shasum check failed for /tmp/npm-1333573304110/1333573499309-0.1599154758732766/tmp.tgz
ERR! Expected: 1ceb545541dce5531c12187b80de902718a6afd2
ERR! Actual: a3920de4ba03316b05b8c94163ea39ba3db434cc
ERR! at /usr/local/lib/node_modules/npm/lib/utils/sha.js:25:20
ERR! at [object Object].<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/sha.js:49:5)
ERR! at [object Object].emit (events.js:64:17)
ERR! at afterRead (fs.js:1111:12)
ERR! at Object.wrapper [as oncomplete] (fs.js:254:17)
ERR! You may report this log at:
ERR! <http://github.com/isaacs/npm/issues>
ERR! or email it to:
ERR! <[email protected]>
ERR!
ERR! System Linux 3.0.0-12-generic
ERR! command "node" "/usr/local/bin/npm" "install" "node-xmpp-bosh"
ERR! cwd /home/frederic
ERR! node -v v0.6.3
ERR! npm -v 1.1.15
ERR! message shasum check failed for /tmp/npm-1333573304110/1333573499309-0.1599154758732766/tmp.tgz
ERR! message Expected: 1ceb545541dce5531c12187b80de902718a6afd2
ERR! message Actual: a3920de4ba03316b05b8c94163ea39ba3db434cc
verbose exit [ 1, true ]
什么'LS -l/usr/local/lib/bosh/run-server.js' show? – sarnold 2012-04-01 23:03:39
It shoes:'-rw -r - r-- 1 root root 4889 2012-04-01 18:50/usr/local/lib/bosh/run-server.js' – megueloby 2012-04-02 11:12:03
您可能需要为该脚本提供可执行文件权限:chmod + x /usr/local/lib/bosh/run-server.js – dhruvbird 2012-04-03 18:17:14