Skip to content

fix(create): install the default scripts on Windows - #1840

Merged
joeyguerra merged 1 commit into
hubotio:mainfrom
b84330808:fix-create-npm-install-windows
Oct 28, 2026
Merged

joeyguerra merged 1 commit into
hubotio:mainfrom
b84330808:fix-create-npm-install-windows

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

hubot --create on Windows creates the bot but never installs hubot-help, hubot-rules, hubot-diagnostics or the --adapter package. #1770 moved the npm calls in GenHubot.mjs to shell: true so npm.cmd can start, but this one call was left without it. Without a shell, spawnSync('npm', …) fails with ENOENT on Windows, and the only trace is an empty npm i log line, while the generated external-scripts.json still lists the three scripts.

This adds { shell: true, stdio: 'inherit' } to that call, like the other npm calls.

The test puts a fake npm on the PATH (an npm.cmd shim on Windows) that only records its arguments, runs bin/Hubot.mjs --create, and checks that the default scripts were installed. It fails on Windows without the fix, and the Windows workflow runs it.

I used Claude Code to write this change.

`hubot --create` runs every npm command through the shell except the one
that installs hubot-help, hubot-rules, hubot-diagnostics and the adapter.
On Windows npm is `npm.cmd`, which spawnSync cannot start without a
shell, so that install fails with ENOENT and nothing reports it. The
generated bot then lists those scripts in external-scripts.json without
having them installed.

Run that command with `shell: true` and inherited stdio like the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@joeyguerra
joeyguerra merged commit 083df91 into hubotio:main Oct 28, 2026
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 14.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants