Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Can't start hubot on debian #132

Closed
stuartf opened this Issue Nov 1, 2011 · 9 comments

Comments

Projects
None yet
3 participants

stuartf commented Nov 1, 2011

I'm following the README, so I run 'npm install' and that completes successfully, then I run 'bin/hubot' and get an error:

bin/hubot: line 6: /home/stuart/src/hubot/node_modules/.bin/hubot: No such file or directory
bin/hubot: line 6: exec: /home/stuart/src/hubot/node_modules/.bin/hubot: cannot execute: No such file or directory

Some google searching reveals that 'npm bundle' will create that, so I run it and it completes successfully. Then I run 'bin/hubot' again and get:

TypeError: object is not a function
         at RegExp.CALL_NON_FUNCTION (native)
         at contains_expr (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:144:23)
         at build_rules (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:77:13)
         at Object.parse (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:224:21)
         at Object.<anonymous> (/home/stuart/src/hubot/node_modules/.npm/hubot/1.1.9/package/bin/hubot:46:10)
         at Object.<anonymous> (/home/stuart/src/hubot/node_modules/.npm/hubot/1.1.9/package/bin/hubot:91:4)
         at Module._compile (module.js:411:26)
         at Object.run (/home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/coffee-script.js:62:19)
         at /home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/command.js:120:29
         at /home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/command.js:90:26
Contributor

atmos commented Nov 1, 2011

Yo,

Can you grab the download from hubot.github.com? You're not supposed to clone the project, it's just a library.

stuartf commented Nov 1, 2011

This was with hubot-1.1.9.tar.gz.

Contributor

atmos commented Nov 1, 2011

Nuke your node_modules folder and keep an eye out for any build failures.

stuartf commented Nov 1, 2011

Just deleting node_modules and running bin/hubot gets me:

--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1516:Tue,01 Nov 11:$)-- rm -rf node_modules/
--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1516:Tue,01 Nov 11:$)-- bin/hubot
'clean' finished successfully (0.008s)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
'configure' finished successfully (0.085s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
'build' finished successfully (0.005s)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
Checking for header expat.h              : yes 
'configure' finished successfully (0.229s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
'build' finished successfully (0.011s)
npm ok
bin/hubot: line 6: /home/stuart/src/hubot/node_modules/.bin/hubot: No such file or directory
bin/hubot: line 6: exec: /home/stuart/src/hubot/node_modules/.bin/hubot: cannot execute: No such file or directory
--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1516:Tue,01 Nov 11:$)-- 

Line 6 of bin/hubot is of course exec node_modules/.bin/hubot "$@"

The only way I know to create the node_modules dir (and maybe this is wrong, this is the first time I've really done anything with node) is npm bundle which goes like:

--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1521:Tue,01 Nov 11:$)-- npm bundle
npm WARN publish-everything xml2js@0.1.11 Adding entire directory to tarball. Please add a
npm WARN publish-everything xml2js@0.1.11 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything irc@0.2.1 Adding entire directory to tarball. Please add a
npm WARN publish-everything irc@0.2.1 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything node-xmpp@0.2.11 Adding entire directory to tarball. Please add a
npm WARN publish-everything node-xmpp@0.2.11 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything request@2.1.1 Adding entire directory to tarball. Please add a
npm WARN publish-everything request@2.1.1 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything node-expat@1.4.0 Adding entire directory to tarball. Please add a
npm WARN publish-everything node-expat@1.4.0 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything ltx@0.1.0 Adding entire directory to tarball. Please add a
npm WARN publish-everything ltx@0.1.0 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything sax@0.3.2 Adding entire directory to tarball. Please add a
npm WARN publish-everything sax@0.3.2 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything tap-producer@0.0.1 Adding entire directory to tarball. Please add a
npm WARN publish-everything tap-producer@0.0.1 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything tap-assert@0.0.10 Adding entire directory to tarball. Please add a
npm WARN publish-everything tap-assert@0.0.10 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything inherits@1.0.0 Adding entire directory to tarball. Please add a
npm WARN publish-everything inherits@1.0.0 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything tap-results@0.0.2 Adding entire directory to tarball. Please add a
npm WARN publish-everything tap-results@0.0.2 .npmignore or specify a 'files' array in the package.json
npm WARN publish-everything yamlish@0.0.2 Adding entire directory to tarball. Please add a
npm WARN publish-everything yamlish@0.0.2 .npmignore or specify a 'files' array in the package.json
Nothing to clean (project not configured)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
'configure' finished successfully (0.122s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
[1/6] cc: libhash/md4c.c -> build/default/libhash/md4c_1.o
[2/6] cc: libhash/md5c.c -> build/default/libhash/md5c_1.o
[3/6] cc: libhash/sha0c.c -> build/default/libhash/sha0c_1.o
[4/6] cxx: hashlib.cc -> build/default/hashlib_2.o
[5/6] cxx_link: build/default/hashlib_2.o build/default/libhash/md4c_1.o build/default/libhash/md5c_1.o build/default/libhash/sha0c_1.o -> build/default/hashlib.node
[6/6] cc_link: build/default/libhash/md4c_1.o build/default/libhash/md5c_1.o build/default/libhash/sha0c_1.o -> build/default/liblibhash.so
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
'build' finished successfully (0.994s)
npm WARN bins installing to /home/stuart/src/hubot/node_modules/.bin, outside PATH
npm WARN bins installing to /home/stuart/src/hubot/node_modules/.bin, outside PATH
npm WARN bins installing to /home/stuart/src/hubot/node_modules/.bin, outside PATH
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
Checking for header expat.h              : yes 
'configure' finished successfully (0.124s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
[1/2] cxx: node-expat.cc -> build/default/node-expat_1.o
[2/2] cxx_link: build/default/node-expat_1.o -> build/default/node-expat.node
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
'build' finished successfully (0.304s)
npm ok

Then bin/hubot gives me:

--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1521:Tue,01 Nov 11:$)-- bin/hubot 
'clean' finished successfully (0.008s)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
'configure' finished successfully (1.533s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/hashlib/1.0.1/package/build'
'build' finished successfully (0.011s)
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /home/stuart/.node_libraries 
Checking for node prefix                 : ok /usr 
Checking for header expat.h              : yes 
'configure' finished successfully (0.190s)
Waf: Entering directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
Waf: Leaving directory `/home/stuart/src/hubot/node_modules/.npm/node-expat/1.4.0/package/build'
'build' finished successfully (0.012s)
npm ok
TypeError: object is not a function
    at RegExp.CALL_NON_FUNCTION (native)
    at contains_expr (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:144:23)
    at build_rules (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:77:13)
    at Object.parse (/home/stuart/src/hubot/node_modules/.npm/optparse/1.0.1/package/lib/optparse.js:224:21)
    at Object.<anonymous> (/home/stuart/src/hubot/node_modules/.npm/hubot/1.1.9/package/bin/hubot:46:10)
    at Object.<anonymous> (/home/stuart/src/hubot/node_modules/.npm/hubot/1.1.9/package/bin/hubot:91:4)
    at Module._compile (module.js:411:26)
    at Object.run (/home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/coffee-script.js:62:19)
    at /home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/command.js:120:29
    at /home/stuart/src/hubot/node_modules/.npm/coffee-script/1.1.1/package/lib/command.js:90:26
--(stuart@battra:pts/8)-------------------------------(/home/stuart/src/hubot)--
--(1523:Tue,01 Nov 11:$)--

toabi commented Nov 2, 2011

Just wanted to deploy the bot on my debian/wheezy and run in the exact same problem.

I checked out some older versions, but they don't work either. I have the exact same stacktrace and error. And I think I found out why:

The problem really is in the optparse module at the location given in the stacktrace. There is a regex which is called as function. Now on my mac, /^--\w/ returns a function, but on the Debian node it doesn't. Hence the 'call non function'. Weird thing is that both run node.js 0.4.12.

toabi commented Nov 2, 2011

Okay just found out how to fix it: https://github.com/jfd/optparse-js contains a recent commit which fixes that behaviour. Just replace the optparse in node_modules with the repostiory and hubot starts! Jey.

Contributor

atmos commented Nov 2, 2011

Which commit? Can you bug them to release a new version with the bugfixes?

toabi commented Nov 2, 2011

It's jfd/optparse-js@c5abef2 — Well I can open an issue that a new version should be released…

stuartf commented Nov 2, 2011

It looks like optparse 1.0.3 has been released, I tried updating the value in package.json, but it looks like that doesn't fix it because the hubot package that gets pulled in still has a dependency on optparse 1.0.1 somewhere.

@atmos atmos closed this in cd2c0f0 Nov 2, 2011

@glucero glucero pushed a commit to absperf/hubot that referenced this issue Aug 20, 2012

@atmos atmos bump optparse version, fixed #132 5448511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment