hubotio / generator-hubot

Hubot generator for Yeoman
MIT License
156 stars 83 forks source link

yo hubot on windows failed #51

Closed ccoenen closed 9 years ago

ccoenen commented 9 years ago

I just created a new hubot instance following the steps in the tutorial. I am using a windows machine with these versions:

node -v
v2.2.1
npm -v
2.11.0
npm list -g --depth 0
C:\Users\user\AppData\Roaming\npm
├── coffee@1.0.0
├── coffee-script@1.9.1
├── generator-hubot@0.3.1
├── http-server@0.7.4
├── node-inspector@0.7.4
└── yo@1.4.7

When running yo hubot, this happened:

C:\Users\users\workspace\hubot-instance> yo hubot
module.js:334
    throw err;
          ^
Error: Cannot find module 'define-properties'
    at Function.Module._resolveFilename (module.js:332:15)
    at Function.Module._load (module.js:282:25)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\generator-hubot\node_modules\yeoman-generator\node_modules\download\node_modules\decompress\node_modules\decompress-tar\node_modules\strip-dirs\node_modules\is-integer\node_modules\is-nan\index.js:3:14)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)

I then installed the missing package: npm install -g define-properties, and tried again to get to the next error:

C:\Users\amenthes\user\hubot-instance> yo hubot
module.js:334
    throw err;
          ^
Error: Cannot find module 'number-is-nan'
    at Function.Module._resolveFilename (module.js:332:15)
    at Function.Module._load (module.js:282:25)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\generator-hubot\node_modules\yeoman-generator\node_modules\download\node_modules\decompress\node_modules\decompress-tar\node_modules\strip-dirs\node_modules\is-integer\node_modules\is-finite\index.js:2:19)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:361:17)

After installing that missing dependency as well (npm install -g number-is-nan), it finally worked.

C:\Users\amenthes\user\hubot-instance> yo hubot
                     _____________________________
                    /                             \
   //\              |      Extracting input for    |
  ////\    _____    |   self-replication process   |
 //////\  /_____\   \                             /
 ======= |[^_/\_]|   /----------------------------
...

It should be noted, that installing the packages locally (without -g) did not work.

Am i missing something, or are these packages missing from yo's or generator-hubot's dependencies?

technicalpickles commented 9 years ago

node -v v2.2.1

Were you using io.js for this? I'm not sure how well tested hubot is on it in general. I don't think that is the issue here, but I just wanted to mention it.

I've reviewed the errors a few times, and it's pretty weird. The things that didn't install are all from yeoman-generator, which generator-hubot depends on, so it's pretty weird they are missing the dependency.

I don't have easy access to Windows to test this unfortunately. Part of me thinks it's an issue with NODE_PATH (ie where node looks for packages), but it's really a shot in the dark :sweat:

ccoenen commented 9 years ago

Yes, that was io. But as far as i understand, io is now merged into node again, so node.js 4.x should show the same results. I just tested with the current version (node.js 4.1.2 at the time of writing).

Today it looks like this:

C:\Users\user\workspace> node -v
v4.1.2

C:\Users\user\workspace> npm -v
2.14.4

C:\Users\user\workspace> npm install -g generator-hubot
npm WARN peerDependencies The peer dependency yo@>=1.0.0 included from generator-hubot will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
generator-hubot@0.3.1 C:\Users\amenthes\AppData\Roaming\npm\node_modules\generator-hubot
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── yosay@0.3.0 (ansi-styles@1.1.0, string-length@0.1.2, ansi-regex@0.2.1, pad-component@0.0.1, word-wrap@0.1.3, minimist@0.2.0, strip-ansi@0.2.2, chalk@0.4.0, taketalk@0.1.1)
├── npm-name@1.1.1 (log-symbols@1.0.2, registry-url@3.0.3, got@3.3.1, meow@3.4.2)
└── yeoman-generator@0.17.7 (dargs@2.1.0, diff@1.4.0, isbinaryfile@2.0.4, class-extend@0.1.1, async@0.9.2, underscore.string@2.4.0, mime@1.3.4, text-table@0.2.0, lodash@2.4.2, iconv-lite@0.4.13, grouped-queue@0.3.0, debug@1.0.4, shelljs@0.3.0, cross-spawn@0.2.9, mkdirp@0.5.1, run-async@0.1.0, nopt@3.0.4, glob@4.5.3, rimraf@2.4.3, github-username@1.1.1, file-utils@0.2.2, findup-sync@0.1.3, gruntfile-editor@0.2.0, download@1.0.7, request@2.64.0, cheerio@0.17.0, inquirer@0.7.3)

C:\Users\user\workspace> yo hubot
... questions ...

Basically: It succeeded on the first try. So i'm closing this. Thanks for getting back to me!

technicalpickles commented 9 years ago

Awesome, glad it's working :confetti_ball: