Vercel uses NPM instead of PNPM

In my MonoRepo when deploying Docs Vercel was detecting PNPM and everything was working fine. After this commit it’s detecting NPM :expressionless: and the deployment fails!

Build Logs:

01:57:54.540 Running build in Washington, D.C., USA (East) – iad1
01:57:54.541 Build machine configuration: 2 cores, 8 GB
01:57:54.690 Cloning github.com/babakfp/mdx-svelte (Branch: main, Commit: 9ab4c6a)
01:57:54.897 Cloning completed: 207.000ms
01:57:56.008 Skipping build cache since Package Manager changed from "pnpm" to "npm"
01:57:56.409 Running "vercel build"
01:57:56.425 Vercel CLI 54.17.2
01:57:57.265 Error while parsing config file: "/vercel/path0/pnpm-lock.yaml"
01:57:57.303 Error while parsing config file: "/vercel/path0/pnpm-lock.yaml"
01:57:57.305 Installing dependencies...
01:57:58.902 npm error code EUNSUPPORTEDPROTOCOL
01:57:58.903 npm error Unsupported URL Type "workspace:": workspace:*
01:57:58.904 npm error A complete log of this run can be found in: /vercel/.npm/_logs/2026-06-25T22_27_57_433Z-debug-0.log
01:57:58.934 Error: Command "npm install" exited with 1

./pnpm-workspace.yaml:

packages:
    - "docs"
    - "package"

./package.json:

{
    "type": "module",
    "packageManager": "pnpm@11.9.0"
}

./docs/package.json:

    // ...
    "type": "module",
    "packageManager": "pnpm@11.9.0"
}

Hi babakfp,

The key clue is this line:

Skipping build cache since Package Manager changed from "pnpm" to "npm"

After that, the workspace:* error is expected because npm is trying to install a pnpm workspace project. So I’d focus on why Vercel switched package-manager detection, not on the dependency itself.

Since this repo is using pnpm@11.9.0, I’d avoid relying only on automatic lockfile detection and try Corepack explicitly.

In Vercel Project Settings → Environment Variables, add:

ENABLE_EXPERIMENTAL_COREPACK=1

Then keep the package manager pinned in the repository root package.json:

{
  "packageManager": "pnpm@11.9.0"
}

After that, redeploy without build cache.

I’d also double-check the project Root Directory. If the Vercel project is deploying the docs app from a monorepo, the root directory and workspace file should line up with this:

packages:
  - "docs"
  - "package"

If it still chooses npm after Corepack is enabled, I’d try a temporary install command override for one deploy:

corepack enable && pnpm install --frozen-lockfile

I would not use plain pnpm install as the override unless you confirm which pnpm version Vercel is using, because the problem here looks version/detection-related.