netpro2k / hubot-skype

Skype adapter for hubot
MIT License
131 stars 46 forks source link

Cannot find module 'hubot' #12

Closed bwiggs closed 11 years ago

bwiggs commented 11 years ago

This is probably something silly, but I can't figure it out. Installed hubot, then added hubot-skype to hubot's package.json:

{
  "name":        "hubot",
  "version":     "2.4.6",
  "author":      "hubot",
  "keywords":    ["github","hubot","campfire","bot"],
  "description": "A simple helpful Robot for your Company",
  "licenses":     [{
    "type":       "MIT",
    "url":        "http://github.com/github/hubot/raw/master/LICENSE"
  }],

  "repository" : {
    "type": "git",
    "url":  "https://github.com/github/hubot.git"
  },

  "dependencies": {
    "hubot-skype": "git://github.com/netpro2k/hubot-skype.git",
    "coffee-script": "~> 1.4.0",
    "optparse": "1.0.3",
    "scoped-http-client": "0.9.7",
    "log": "1.3.0",
    "connect": "2.3.4",
    "connect_router": "1.8.6"
  },

  "engines": {
    "node": ">= 0.8.x",
    "npm": "1.1.x"
  },

  "main": "./index",

  "bin": {
    "hubot": "./bin/hubot"
  }
}

When I try to run using the skype adapter I get the following:

$ bin/hubot -a skype
[Mon Jan 28 2013 23:54:01 GMT-0700 (MST)] ERROR Cannot load adapter skype - Error: Cannot find module 'hubot'
TypeError: Cannot call method 'on' of null
    at Object.<anonymous> (/Users/brianwigginton/Projects/hubot-master/bin/hubot:136:19)
    at Object.<anonymous> (/Users/brianwigginton/Projects/hubot-master/bin/hubot:140:4)
    at Module._compile (module.js:449:26)
    at Object.exports.run (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:83:25)
    at compileScript (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/command.js:177:29)
    at fs.stat.notSources.(anonymous function) (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/command.js:152:18)
    at fs.readFile (fs.js:176:14)
    at Object.oncomplete (fs.js:297:15)

Here's the npm modules I have installed:

$ npm list
hubot@2.4.6 /Users/brianwigginton/Projects/hubot-master
├── coffee-script@1.4.0
├─┬ connect@2.3.4
│ ├── bytes@0.0.1
│ ├── cookie@0.0.4
│ ├── crc@0.2.0
│ ├── debug@0.7.0
│ ├── formidable@1.0.11
│ ├── fresh@0.0.1
│ ├── mime@1.2.4
│ ├── qs@0.4.2
│ └── range-parser@0.0.4
├── connect_router@1.8.6
├── hubot-skype@0.0.2
├── log@1.3.0
├── optparse@1.0.3
└── scoped-http-client@0.9.7
bwiggs commented 11 years ago

Just as I thought, i was being stupid. Needed to actually install hubot after downloading the latest from github using hubot -c path/to/dest. Then update the package.json file in the installed directory. Seems to be working fine now.