Skip to content

No able to run ./run-server.js #98

Closed
walidsynclio opened this Issue Jan 16, 2014 · 10 comments

2 participants

@walidsynclio

Hi,
On ubuntu I have installed nodejs from apt-get and npm dependencies with npm install -g npm.
cloned node-xmpp-bosh
when run ./run-server.js
I get error
module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module '../build/Release/node_expat.node'
at Function.resolveFilename (module.js:337:11)
at Function.load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (/root/node-xmpp-bosh/node_modules/node-expat/lib/node-expat.js:4:13)
at Module.compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function.load (module.js:311:12)
at Module.require (module.js:359:17)
Do you guys mind updating your instructions on latest node and npm.

@dhruvbird
Owner

Did you run npm install . from within the cloned directory?

@walidsynclio

Yes I did that.
It runs with some Errors

npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/nan

node-expat@2.0.0 install /root/node-xmpp-bosh/node_modules/node-expat
node-gyp rebuild

npm http 304 https://registry.npmjs.org/underscore/1.1.5
npm ERR! node-expat@2.0.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "node" "/usr/bin/npm" "install" "."
npm ERR! cwd /root/node-xmpp-bosh
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.3.23
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/sax
npm WARN engine node-expat@2.1.4: wanted: {"node":">=0.8"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm http 200 https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cssom/-/cssom-0.2.5.tgz
npm http 200 https://registry.npmjs.org/cssstyle
npm http GET https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.9.tgz
npm http 200 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http 304 https://registry.npmjs.org/commander
npm http 200 https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.7.tgz
npm http 200 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/contextify/-/contextify-0.1.6.tgz
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/nan

ws@0.4.29 install /root/node-xmpp-bosh/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

npm http 200 https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.9.tgz
npm http 200 https://registry.npmjs.org/cssom/-/cssom-0.2.5.tgz
npm http 200 https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http GET https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/nan
npm http 200 https://registry.npmjs.org/contextify/-/contextify-0.1.6.tgz
npm http 200 https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.7.tgz

node-expat@2.1.4 install /root/node-xmpp-bosh/node_modules/ltx/node_modules/node-expat
node-gyp rebuild

npm http 200 https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/request/-/request-2.33.0.tgz
npm http 200 https://registry.npmjs.org/request/-/request-2.33.0.tgz
npm http 200 https://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/aws-sign2
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/cssom/-/cssom-0.3.0.tgz
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/json-stringify-safe

contextify@0.1.6 install /root/node-xmpp-bosh/node_modules/jsdom/node_modules/contextify
node-gyp rebuild

npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/http-signature
npm WARN optional dep failed, continuing contextify@0.1.6
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/form-data
npm http 200 https://registry.npmjs.org/cssom/-/cssom-0.3.0.tgz
npm http 304 https://registry.npmjs.org/hawk
npm http 200 https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz
npm http 200 https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz
npm WARN engine http-signature@0.10.0: wanted: {"node":">=0.8"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm WARN engine hawk@1.0.0: wanted: {"node":">=0.8.0"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/punycode
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/sntp
npm WARN engine boom@0.4.2: wanted: {"node":">=0.8.0"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm WARN engine cryptiles@0.2.2: wanted: {"node":">=0.8.0"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm WARN engine hoek@0.9.1: wanted: {"node":">=0.8.0"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm WARN engine sntp@0.2.4: wanted: {"node":">=0.8.0"} (current: {"node":"v0.6.19","npm":"1.3.23"})
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/node-xmpp-bosh/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 1

@dhruvbird
Owner

You seem to have multiple failures because of the version of node.js you are using.

npm WARN engine node-expat@2.1.4: wanted: {"node":">=0.8"} (current: {"node":"v0.6.19","npm":"1.3.23"})

@walidsynclio

Now I have node version v0.10.24
cloned node-xmpp-bosh went inside and run npm install .
I am getting this.

root@abul-VirtualBox:~/node-xmpp-bosh# sudo npm install .
npm http GET https://registry.npmjs.org/ltx
npm http GET https://registry.npmjs.org/tav
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/eventpipe
npm http GET https://registry.npmjs.org/dns-srv/0.3.0
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/ws/0.4.29
npm http GET https://registry.npmjs.org/node-lumberjack/0.0.4
npm http GET https://registry.npmjs.org/ejs
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/jslint
npm http GET https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/ltx
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/eventpipe
npm http 304 https://registry.npmjs.org/tav
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/node-lumberjack/0.0.4
npm http 304 https://registry.npmjs.org/dns-srv/0.3.0
npm http 304 https://registry.npmjs.org/ejs
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/ws/0.4.29
npm http 304 https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/jslint
npm http GET https://registry.npmjs.org/underscore/1.1.5
npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/cssstyle
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options

node-expat@2.0.0 install /root/node-xmpp-bosh/node_modules/node-expat
node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-17-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-xmpp-bosh/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/underscore/1.1.5
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/cssstyle
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/tough-cookie
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/aws-sign2
npm http 304 https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/punycode
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5

ws@0.4.29 install /root/node-xmpp-bosh/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! node-expat@2.0.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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-expat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "."
npm ERR! cwd /root/node-xmpp-bosh
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE

node-expat@2.1.4 install /root/node-xmpp-bosh/node_modules/ltx/node_modules/node-expat
node-gyp rebuild

Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-17-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-xmpp-bosh/node_modules/ltx/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok

contextify@0.1.6 install /root/node-xmpp-bosh/node_modules/jsdom/node_modules/contextify
node-gyp rebuild

Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-17-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-xmpp-bosh/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm WARN optional dep failed, continuing contextify@0.1.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/node-xmpp-bosh/npm-debug.log
npm ERR! not ok code 0

@dhruvbird
Owner

I would first try deleting the node_modules folder

cd node-xmpp-bosh
rm -Rf node_modules
npm install .

If that still fails, I would try installing node-expat by itself and see if that works.

cd node-xmpp-bosh
npm install node-expat
@walidsynclio

Hi,
I have deleted /usr/lib/node_modules uninstalled nodejs
reinstalled nodejs and tried sudo npm install .
as well as root@abul-VirtualBox:~/node-xmpp-bosh# sudo npm install node-expat

And I get this:

npm WARN package.json eventpipe@0.0.5 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json jsdom@0.2.19 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json node-lumberjack@0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm http GET https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/node-expat

node-expat@2.0.0 install /root/node-xmpp-bosh/node_modules/node-expat
node-gyp rebuild

Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.5.0-17-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-xmpp-bosh/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-expat@2.0.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "node-expat"
npm ERR! cwd /root/node-xmpp-bosh
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/node-xmpp-bosh/npm-debug.log
npm ERR! not ok code 0

@dhruvbird
Owner

Great - is it possible for you to open an issue with node-expat since it seems to be an issue at that end?

@dhruvbird
Owner

Any update on this one?

@walidsynclio

This is done. it was complaining because it needed an older version of python.
Thanks for the help.

@dhruvbird
Owner

Great - thanks for the update.

@dhruvbird dhruvbird closed this Jan 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.