hubotio / generator-hubot

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

Error running `yo hubot` #115

Open lukeasrodgers opened 4 months ago

lukeasrodgers commented 4 months ago

I'm following the instructions here: https://hubot.github.com/docs/.

I have successfully run npm install -g yo generator-hubot.

$ yo --version
5.0.0
$ npm -v
10.8.1
$ node -v
v22.3.0

Then I mkdir hubot && cd hubot, and run yo hubot and accept all defaults.

(node:76306) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? My Owner hubot
? Bot name mybot
? Description A simple helpful robot for your Company
? Bot adapter shell
                     _____________________________
                    /                             \
   //\              |      Extracting input for    |
  ////\    _____    |   self-replication process   |
 //////\  /_____\   \                             /
 ======= |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

✖ An error occured while running hubot:app#writing
Error hubot

Cannot read properties of null (reading 'fromBasePath')
➜  hubot

yo doctor checks out

➜  hubot yo doctor

Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
✔ yo version

Everything looks all right!
➜  hubot

Seems like the same problem as this person: https://stackoverflow.com/questions/78616874/error-cannot-read-properties-of-null-reading-frombasepath-on-hubot-creating.

I think the problem is this line this.copyTemplate('scripts/', 'scripts/', null, this.props) from app/index.js, which appears to have been fixed in dd084f6d. Seems like maybe just need to cut a new release of this package.

joeyguerra commented 4 months ago

Yes, that should fix it. But I don't have permissions to update the invalid NPM_TOKEN in the CI environment variables so I can't publish a new version. Nor do I have permissions to update the site at hubot.github.com. I've updated the docs in the repo though.

I suggest using npx hubot to create new bots instead of yo hubot.

Btw, I'd love to hear how your using Hubot. Would you be willing to share your story?