Vercel build uses npm despite pnpm workspace, Corepack, & UI overrides

Current Behavior

When I deploy my monorepo project, the Vercel build log shows it is running the npm install command. This immediately causes the build to fail with the error npm error Unsupported URL Type “workspace:”: workspace:*.

Expected Behavior

Vercel’s build process should detect that my project is a pnpm workspace and run the pnpm install command, as specified in my Vercel project settings.


Code, Configuration, and Steps to Reproduce

This is a Vite-based monorepo that uses pnpm workspaces. The issue can be reproduced by deploying the project with the following configuration.

1. Project Structure:

A standard monorepo structure with apps and a shared package. The Root Directory in Vercel is set to partner.

text

/

├── admin/

├── partner/

│ └── package.json (depends on “@localplus/shared”: “workspace:*”)

├── shared/

│ └── package.json (name: “@localplus/shared”)

├── package.json

├── pnpm-lock.yaml

└── pnpm-workspace.yaml

2. Root package.json:

The root package.json specifies pnpm as the package manager and includes a build script to run workspace builds.

json

{

“name”: “localplus-super-app”,

“private”: true,

“packageManager”: “pnpm@10.15.0”,

“scripts”: {

"build": "pnpm --parallel build",

*// ... other scripts*

}

}

3. pnpm-workspace.yaml:

This file correctly defines all the workspaces in the project.

yaml

packages:

  • ‘admin’

  • ‘partner’

  • ‘shared’

  • ‘src’

4. partner/package.json Dependency:

The partner app correctly depends on the local shared package using the workspace:* protocol.

json

{

“name”: “localplus-partner-app”,

// …

“dependencies”: {

"@localplus/shared": "workspace:\*",

*// ... other dependencies*

}

}


Project Information

  • Project URL: [VERCEL PROJECT URL ]

  • Framework: Vite (but set to “Other” in Vercel settings)

  • Environment: Production

  • Vercel Project Settings:

  • Root Directory: partner

  • Framework Preset: Set to “Other”.

  • Build & Development Settings:

  • Install Command: Overridden and set to pnpm install.

  • Build Command: Overridden and set to pnpm --filter partner… build.

  • Environment Variables: ENABLE_EXPERIMENTAL_COREPACK is set to 1.

Despite this comprehensive setup, every deployment log confirms that Vercel is still running npm install. I have also tried redeploying with the build cache cleared multiple times.

Any help would be greatly appreciated. Thank you!

Hi, It looks like you have Project override set for Build command: Login – Vercel