github/hubot — Issue #232: Error: Cannot find module 'optparse' 
Author: benhamill
Created: 2012-01-31 06:38:48+00:00
State: open

I'm trying to install Hubot on an Ubuntu server. Based on the [relevat wiki page](https://github.com/github/hubot/wiki/Deploying-Hubot-onto-UNIX), I started off like this:

# apt-get install build-essential libssl-dev git-core redis-server libexpat1-dev

Then I built Node from source:

```
# wget http://nodejs.org/dist/v0.6.9/node-v0.6.9.tar.gz
# tar xf node-v0.6.9.tar.gz -C /usr/local/src && cd /usr/local/src/node-v0.6.9
# ./configure && make && make install
```

Then I ran `npm install -g coffee-script` to install coffee-script. Everything seemed to go fine up to that point. Then, I thought I'd use `npm` to download the stable release and use `hubot -c` to dump it into a directory where I could monkey with it:

```
# npm install -gf hubot
npm http GET https://registry.npmjs.org/hubot
npm http 304 https://registry.npmjs.org/hubot
npm http GET https://registry.npmjs.org/hubot/-/hubot-2.1.2.tgz
npm http 200 https://registry.npmjs.org/hubot/-/hubot-2.1.2.tgz
npm http GET https://registry.npmjs.org/coffee-script/1.2.0
npm http GET https://registry.npmjs.org/optparse/1.0.3
npm http GET https://registry.npmjs.org/scoped-http-client/0.9.6
npm http GET https://registry.npmjs.org/log/1.2.0
npm http 304 https://registry.npmjs.org/coffee-script/1.2.0
npm http GET https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm http 304 https://registry.npmjs.org/log/1.2.0
npm http 304 https://registry.npmjs.org/optparse/1.0.3
npm http 304 https://registry.npmjs.org/scoped-http-client/0.9.6
npm http GET https://registry.npmjs.org/log/-/log-1.2.0.tgz
npm http GET https://registry.npmjs.org/optparse/-/optparse-1.0.3.tgz
npm http GET https://registry.npmjs.org/scoped-http-client/-/scoped-http-client-0.9.6.tgz
npm http 200 https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm http 200 https://registry.npmjs.org/log/-/log-1.2.0.tgz
npm http 200 https://registry.npmjs.org/optparse/-/optparse-1.0.3.tgz
npm http 200 https://registry.npmjs.org/scoped-http-client/-/scoped-http-client-0.9.6.tgz
/usr/local/bin/hubot -> /usr/local/lib/node_modules/hubot/bin/hubot
hubot@2.1.2 /usr/local/lib/node_modules/hubot
├── optparse@1.0.3
├── log@1.2.0
├── scoped-http-client@0.9.6
└── coffee-script@1.2.0
```

OK. Looks fine. Now let's see the console to make sure it worked:

```
# hubot
Error: Cannot find module 'optparse'
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:373:17)
at Object. (/usr/local/lib/node_modules/hubot/bin/hubot:15:14)
at Object. (/usr/local/lib/node_modules/hubot/bin/hubot:108:4)
at Module._compile (module.js:444:26)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:135:29
at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:110:18
```

OHNOES. :poop:

It looks like optparse installed okay to me. Am I doing something quite wrong, here? FWIW:

```
# node --version
v0.6.9
# npm --version
1.1.0-3
```

Any advice would be appreciated.