[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Vercel forcing pnpm instead of npm despite installCommand configuration in monorepo

113 views · 0 likes · 3 posts


Alex888 (@alexchabeur-2366) · 2025-12-18

\# Vercel Forcing pnpm Despite npm Configuration in Monorepo

\## Current versus Expected behavior

\*\*Current Behavior:\*\*

\- Vercel executes \`pnpm install\` during deployment

\- Build logs show: \`> Detected Turbo. Adjusting default settings...\` followed by \`Running "install" command: pnpm install\`

\- This causes \`ERR_PNPM_META_FETCH_FAIL\` and \`ERR_INVALID_THIS\` errors

\- All deployments fail with: \`Error: Command "pnpm install" exited with 1\`



\*\*Expected Behavior:\*\*

\- Vercel should execute \`npm install --legacy-peer-deps\` as specified in configuration

\- Build should proceed without pnpm-related errors

\## Code, configuration, and steps that reproduce this issue

\### Repository Structure

\`\`\`

monorepo/

├── vercel.json (root)

├── package.json (root - has workspaces)

├── apps/

│   └── web/

│       ├── vercel.json

│       ├── package.json

│       └── .npmrc

└── packages/

\`\`\`

\### Configuration Files

\*\*Root \`vercel.json\`:\*\*

\`\`\`json

{

"version": 2,

"installCommand": "",

"buildCommand": "cd apps/web && npm install --legacy-peer-deps && npm run build",

"framework": "nextjs",

"outputDirectory": "apps/web/.next"

}

\`\`\`



\*\*\`apps/web/vercel.json\`:\*\*

\`\`\`json

{

"version": 2,

"installCommand": "",

"buildCommand": "npm install --legacy-peer-deps && npm run build",

"framework": "nextjs"

}

\`\`\`



\*\*Root \`package.json\` (relevant parts):\*\*

\`\`\`json

{

"packageManager": "npm@10.9.2",

"workspaces": \[

"apps/\*",

"packages/\*"

  \]

}

\`\`\`



\*\*\`apps/web/package.json\` (relevant parts):\*\*

\`\`\`json

{

"packageManager": "npm@10.9.2"

}

\`\`\`



\*\*\`.npmrc\` (root and apps/web):\*\*

\`\`\`

legacy-peer-deps=true

registry=https://registry.npmjs.org/

\`\`\`



\### Vercel Dashboard Settings

\- \*\*Root Directory:\*\* \`apps/web\`

\- \*\*Install Command:\*\* (empty - to use vercel.json)

\- \*\*Build Command:\*\* (empty - to use vercel.json)

\- \*\*Framework Preset:\*\* Next.js



\### Steps to Reproduce

1\. Deploy a monorepo with workspaces configuration

2\. Set Root Directory to \`apps/web\` in Vercel Dashboard

3\. Configure \`installCommand: ""\` in vercel.json

4\. Configure \`buildCommand\` with \`npm install --legacy-peer-deps\`

5\. Trigger deployment

6\. Observe build logs showing \`pnpm install\` being executed instead



\### Build Logs (Error)

\`\`\`

Running "vercel build"

\> Detected Turbo. Adjusting default settings...

Running "install" command: \`pnpm install\`...

ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/@types%2Fnode: Value of "this" must be of type URLSearchParams

WARN GET https://registry.npmjs.org/... error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.

Error: Command "pnpm install" exited with 1

\`\`\`



\## Project information



\- \*\*Framework:\*\* Next.js 15.5.7

\- \*\*Node Version:\*\* 20.x

\- \*\*Package Manager:\*\* npm 10.9.2 (preferred)

\- \*\*Monorepo:\*\* Yes (using npm workspaces)

\- \*\*Root Directory:\*\* \`apps/web\`

\- \*\*Vercel Plan:\*\* Hobby



\### What We've Already Tried (All Failed)



1\. ✅ Added explicit \`installCommand: "npm install --legacy-peer-deps"\` in both vercel.json files

2\. ✅ Set \`installCommand: ""\` (empty string) to skip automatic install

3\. ✅ Removed \`installCommand\` completely and embedded npm install in \`buildCommand\`

4\. ✅ Added \`ENABLE_EXPERIMENTAL_COREPACK=1\` environment variable

5\. ✅ Removed all pnpm lockfiles (\`pnpm-lock.yaml\`, \`pnpm-workspace.yaml\`)

6\. ✅ Added \`"packageManager": "npm@10.9.2"\` in both package.json files

7\. ✅ Verified NO \`builds\` property exists in vercel.json

8\. ✅ Created \`.npmrc\` with \`legacy-peer-deps=true\`

9\. ✅ Temporarily removed Turbo (renamed \`turbo.json\` and removed \`turbo\` package from dependencies)



\### Critical Finding



Even after removing Turbo completely (both \`turbo.json\` file and \`turbo\` package), build logs still show:

\`\`\`

\> Detected Turbo. Adjusting default settings...

\`\`\`



This suggests Turbo/monorepo detection happens at a deeper level, possibly based on:

\- Monorepo structure (workspaces in package.json)

\- Vercel's zero-configuration build process running before custom commands



\### Questions



1\. \*\*How does Vercel detect Turbo/monorepo if neither turbo.json nor turbo package exists?\*\*

\- Is detection based on monorepo structure (workspaces) alone?



2\. \*\*Why does Turbo detection override \`installCommand: ""\`?\*\*

\- According to docs, empty string should skip automatic install

\- But Vercel still executes \`pnpm install\`



3\. \*\*What is the exact priority order for package manager detection?\*\*

\- Turbo detection > installCommand > buildCommand?

\- Dashboard settings > vercel.json?



4\. \*\*Is there a way to completely disable automatic package manager detection in monorepos?\*\*

\- We need to force npm regardless of any detection



5\. \*\*Is this a known issue with Vercel's monorepo/Turbo integration?\*\*



Any help or workarounds would be greatly appreciated! We're completely blocked on deployments.


Jacob Paris (@jacobparis) · 2025-12-18

An empty string in the install command does not prevent it from installing, it falls back to the default for the framework setting, which in this case is `pnpm install`

You should use that option to specify your install command. If the --legacy-peer-deps doesn't work there, try adding it as an NPM_RC environment variable


Jacob Paris (@jacobparis) · 2026-01-23

@alexchabeur-2366, have you had a chance to look into the install command configuration? If you're still encountering issues with Vercel defaulting to `pnpm`, let me know if that helps or if you need further assistance!