Vercel will automatically detect the package manager used in your project and install the dependencies when you create a deployment. It does this by looking at the lock file in your project and inferring the correct package manager to use.
If you are using Corepack, Vercel will use the package manager specified in the package.json
file instead.
The following table lists the package managers supported by Vercel, with their install commands and versions:
Package Manager | Lock File | Install Command | Supported Versions |
---|---|---|---|
Yarn | 1 | ||
npm | 6, 7, 8 | ||
pnpm | 6, 7, 8 | ||
Bun 1 | 1 |
While Vercel automatically selects the package manager based on the lock file present in your project, the specific version of that package manager is determined by the version information in the lock file or associated configuration files.
The npm and pnpm package managers create a lockfileVersion
property when they initially generate a lock file. This property specifies the lock file's format version, ensuring proper processing and compatibility. For example, a package-lock.json
file with lockfileVersion: 2
will be interpreted by npm 8, while a package-lock.json
file with lockfileVersion: 1
will be interpreted by npm 6.
Package Manager | Condition | Install Command | Version Used |
---|---|---|---|
pnpm | pnpm-lock.yaml : present | pnpm install | Varies |
lockfileVersion : 6.0 | - | pnpm 8 | |
lockfileVersion : 5.4 | - | pnpm 7 | |
Otherwise | - | pnpm 6 | |
npm | package-lock.json | npm install | Varies |
lockfileVersion : 2 | - | npm 8 | |
Otherwise | - | npm 6 | |
Bun | bun.lockb : present | bun install | Bun 1 |
Yarn | yarn.lock : present | yarn install | Yarn 1 |
When no lock file exists, Vercel uses Yarn 1 or pnpm 6 from the build container. Npm's version aligns with the Node.js version; for Node 18, it's npm 9. Defaults can be overridden using installCommand
or Corepack for specific npm versions.
You can manually specify a package manager to use on a per-project, or per-deployment basis.
To specify a package manager for all deployments in your project, use the Override setting in your project's Build & Development Settings:
- Navigate to your dashboard and select your project
- Select the Settings tab
- From the left navigation, select General
- Enable the Override toggle in the Build & Development Settings section and add your install command. Once you save, it will be applied on your next deployment
pnpm install
, Vercel will use the oldest version of the specified package manager available in the build container. For example, if you specify pnpm install
as your override install command, Vercel will use pnpm 6.To specify a package manager for a deployment, use the installCommand
property in your projects vercel.json
.
{
"installCommand": "pnpm install"
}
Was this helpful?