create-vinext-app generates `packageManager` without a pnpm version on windows, causing corepack to fail
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start in packages/create-vinext-app/src/index.ts by reading getPackageManagerVersion() and writePackageJson(), then reproduce the Windows Corepack scenario described in the issue. Verify that generated package.json includes a detected pnpm version and that project creation completes when version detection fails or succeeds.
Written by the indexing model from the issue text.
Description
Description
Creating a project with create-vinext-app on Windows using pnpm and the default options, including the Cloudflare deployment target, fails during dependency installation:
No version specified for pnpm in "packageManager" of package.json
Command failed with exit code 1: pnpm add vinext react-server-dom-webpack @vinext/cloudflare
The scaffolder generates:
{
"packageManager": "pnpm"
}
Corepack requires a version in this field, such as [email protected], and rejects the generated value before dependency installation can proceed.
Reproduction
On Windows with a Corepack-managed pnpm installation:
-
Verify that
pnpm --versionworks in the starting directory. -
Run:
pnpm create vinext-app -
Accept the default options, including Cloudflare.
-
Observe the installation failure.
-
Inspect the generated
package.json:packageManagercontainspnpmwithout a version.
Expected behavior
Project creation should complete successfully.
The generated packageManager field should include the detected pnpm version. If version detection fails, the scaffolder should handle that failure without writing a value that Corepack rejects.
Suspected cause
In packages/create-vinext-app/src/index.ts, getPackageManagerVersion() invokes:
spawnSync(packageManager, ["--version"], {
encoding: "utf-8",
stdio: ["ignore", "pipe", "ignore"],
});
In the Windows installation used for local reproduction, pnpm is exposed through a Corepack pnpm.cmd launcher. Calling spawnSync("pnpm", ["--version"]) directly fails with ENOENT, returning status: null.
Consequently, version detection returns null. writePackageJson() then falls back to the package manager name:
packageManager: version ? `${packageManager}@${version}` : packageManager,
This writes "packageManager": "pnpm", which causes the subsequent Corepack invocation to fail.
- Dominant language
- TypeScript
- Stars
- 9.2k
- Forks
- 441
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 437
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/vinext
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/vinext#4115 ·
Maintainers usually reply within 1 day
-
nextjs-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
cloudflare/vinext#3920 ·
Maintainers usually reply within 1 day
-
nextjs-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cloudflare/vinext#3887 ·
Maintainers usually reply within 1 day
-
docs: document deployment with Cloudflare Workers Builds / Git integrationPossibly taken @reginaldalfret claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/vinext#3738 ·
Maintainers usually reply within 1 day
-
Standalone server.js does not default NODE_ENV to productionPossibly taken @reginaldalfret claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/vinext#3444 ·
Maintainers usually reply within 1 day
All issues in cloudflare/vinext
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
equinor/prisma-decision-web#919 ·
Maintainers usually reply within 1 day
-
[DC] OneLogin sync imports a partial user list when an API request failsPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bitwarden/directory-connector#1276 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
home-assistant/installer#324 ·
Maintainers usually reply within 1 day
-
Mondriaan
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
knaw-huc/textannoviz#733 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day