How to install legacy-peer-deps while deploying in vercel
11/15/2025 — Izzaz
The most simple way to let vercel know that you want to install an npm package with legacy dependencies while deploying it to vercel it by doing the following:
Step 1. Create a file and named it .npmrc in the root folder of your project.
Step 2. Inside it add this line:
legacy-peer-deps=true
This simple code will do the following:
➡️ Vercel will automatically read this.
➡️ This forces all installs (local + Vercel) to use legacy peer deps.