Skip to content

fix(create-vite): handle double dash for npm exec#21830

Merged
sapphi-red merged 1 commit into
vitejs:mainfrom
sapphi-red:fix/create-vite-handle-double-dash-for-npm-exec
Mar 12, 2026
Merged

fix(create-vite): handle double dash for npm exec#21830
sapphi-red merged 1 commit into
vitejs:mainfrom
sapphi-red:fix/create-vite-handle-double-dash-for-npm-exec

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

fixes #21614
close #21648

@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) feat: create-vite create-vite package labels Mar 12, 2026
@sapphi-red sapphi-red added this to the 8.0 milestone Mar 12, 2026
.replace(/^npm exec (?:-- )?/, () => {
// Prefer `pnpm dlx`, `yarn dlx`, or `bun x`
if (pkgManager === 'pnpm') {
// pnpm doesn't support the -- syntax
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need this comment as the other pms are also handled this way

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn and bun supports -- so we don't have to remove for them

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But with the regex we're removing it anyways no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are, but we don't have to. The comment is to tell that it is necessary for pnpm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I was confused that the comment is about the "pnpm dlx " but it's only a note comment in general and not about the string.

Not really a big deal either ways.

@sapphi-red sapphi-red merged commit e4bcd59 into vitejs:main Mar 12, 2026
18 checks passed
@sapphi-red sapphi-red deleted the fix/create-vite-handle-double-dash-for-npm-exec branch March 12, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: create-vite create-vite package p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when creating Vite React app with TanStack Router using pnpm

2 participants