Skip to content

Commit 1bf5d0f

Browse files
committed
fix(create): stop forwarding -- to npx-invoked remote templates
`formatDlxCommand` injected `--` between the package name and its args on the npx path, producing `npx <pkg> -- <args>`. Per the npm v8 `npx` docs, the documented form places `--` before the package name; the trailing `--` is forwarded to the underlying binary. Commander-based subcommand CLIs (e.g., `@tanstack/cli create`) interpret it as end-of-options and promote subsequent flags into positionals, exceeding the subcommand's arity. Drop the `--` injection for npx; pnpm/yarn/bun paths unchanged.
1 parent 9b57c4b commit 1bf5d0f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/cli/src/create/command.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ export function formatDlxCommand(
168168
workspaceInfo: WorkspaceInfo,
169169
) {
170170
const runner = getPackageRunner(workspaceInfo);
171-
const dlxArgs = runner.command === 'npx' ? ['--', ...args] : args;
172171
return {
173172
command: runner.command,
174-
args: [...runner.args, packageName, ...dlxArgs],
173+
args: [...runner.args, packageName, ...args],
175174
};
176175
}
177176

0 commit comments

Comments
 (0)