megueloby
megueloby

Reputation: 81

node-xmpp-bosh error on ubuntu

I want to implement a bosh server. Because it is hard on Windows platform I decided to deploy it on an Ubuntu virtual machine via VMware. I made installation without problems. I took the process on this page: http://code.google.com/p/node-xmpp-bosh/wiki/DebianHowTo. Now I want to test my bosh server with the command sudo bosh or sudo /etc/init.d/bosh start on the console I have Starting bosh server. After nothing.

I look the bosh.err file and I see exec: 2: /usr/local/lib/bosh/run-server.js: Permission denied I don̍ t know why this error with sudo.


I gave executable permission like dhruvbird said: chmod +x /usr/local/lib/bosh/run-server.js.

Now when I execute the command sudo bosh I have Starting bosh on the terminal and bosh.err has this:

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)̍

And when I execute the command sudo /etc/init.d/bosh start I always have Starting bosh on the terminal and this on the bosh.err:

/usr/bin/env: node: No such file or directory

And my bosh server doesn't work.


I run dpkg -L nodejs | grep bin or dpkg -L node | grep bin and I can read that the package is not install for each test. I run apt-get update && apt-get install -u nodejs and apt-get update && apt-get install -u node and always the same result. When I run node -v and have v0.6.3 and I think this means that node is install. And I have the node directory on home/node. Is it a problem of path?


I try to run npm install node-xmpp-bosh and this is the result on 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 ]

Upvotes: 1

Views: 1125

Answers (3)

Taras
Taras

Reputation: 582

I had the same problems on one of my servsers CentOS release 6.4 (Final) I have fixed it using these commands:

# yum install nodejs
# yum install npm
# npm install ltx
# npm install underscore
# npm install node-lumberjack
# npm install node-uuid
# npm install eventpipe
# npm install node-expat
# npm install ejs
# npm install dns-srv
# npm install tav
# npm install ws

Upvotes: 0

topless
topless

Reputation: 8221

To fix /usr/bin/env: node: No such file or directory you can execute sudo apt-get install nodejs-legacy

Upvotes: 0

sarnold
sarnold

Reputation: 104020

/usr/bin/env: node: No such file or directory

This means bosh has been written to use an odd little idiom for shell scripts:

#!/usr/bin/env node

This runs the env(1) program, which will search its PATH for the node executable and execute it with a modified environment -- but, without environment modifications, it just runs node. It's a bit silly, but it is also the easiest way to write a script that doesn't hardcode the path to its interpreter.

You don't have a node program executable on your system. Perhaps node isn't yet installed. (I have a vague memory that old versions were actually named nodejs -- but I cannot find documentation to support this memory.)

To make sure node is installed, run:

apt-get update && apt-get install -u nodejs

If the nodejs package is already installed, then perhaps the executable name is different. Run dpkg -L nodejs | grep bin, and look for the executable name in the output. If you don't see /usr/bin/node, I'll help walk you through setting up a symbolic link.

Upvotes: 1

Related Questions