Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete postinstall script fails on single template #46

Closed
dominics opened this issue Jan 9, 2025 · 1 comment · Fixed by #48
Closed

Autocomplete postinstall script fails on single template #46

dominics opened this issue Jan 9, 2025 · 1 comment · Fixed by #48
Assignees

Comments

@dominics
Copy link

dominics commented Jan 9, 2025

Describe the bug

The postinstall script in the single template's package.json fails on install

To Reproduce

npx @stricli/create-app@latest --template single my-app
cd my-app
npm install

Expected behavior

Install completes with no errors

Actual behavior is (npm install proceeds as normal, then):

> my-app@0.0.0 postinstall
> npx @stricli/auto-complete@latest install my-app __my-app_bash_complete

Too many arguments, expected 1 but encountered "__my-app_bash_complete"

and exit code 252

Environment:

MacOS X, bash
node v18.19.0, npm 10.2.3

Additional context

I think the command should have been: npx @stricli/auto-complete@latest install --bash my-app __my-app_bash_complete (i.e. it's missing the --bash bit)

I've seen the same failure when trying to use pnpm dlx.

Also, the multiple command template fails in a different way when using pnpm, because the in-project package.json "bin" entries are't accessible from the path of the "scripts" by default). But that's a separate issue relating to pnpm support - possibly related to pnpm/pnpm#7461 - where the workaround is to add an entry matching the bin entry to the scripts. I just mention it here because that's what I'm actually using, even though the above reproduction happens on npm

@molisani
Copy link
Member

Ack, thanks for reporting this. It seems like a simple fix, and I'll tackle it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants