#3322·vinext

create-vinext-app generates `packageManager` without a pnpm version on windows, causing corepack to fail

Author: NriotHrreionCreated Sep 18, 2026Updated Sep 18, 2026

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:

json
{
  "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:

  1. Verify that pnpm --version works in the starting directory.

  2. Run:

    bash
    pnpm create vinext-app
  3. Accept the default options, including Cloudflare.

  4. Observe the installation failure.

  5. Inspect the generated package.json: packageManager contains pnpm without 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:

typescript
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:

https://github.com/cloudflare/vinext/blob/e97de291c805653f46fdd43a3840920a4611a8e1/packages/create-vinext-app/src/index.ts#L409-L415

typescript
packageManager: version ? `${packageManager}@${version}` : packageManager,

This writes "packageManager": "pnpm", which causes the subsequent Corepack invocation to fail.