How do I use the latest npm version for my Vercel Deployment?

You can use the latest npm version for your Vercel Deployments by using one of the three following ways.

Autodetection

During the Build Step, Vercel will automatically detect the Install Command based on the presence of either pnpm-lock.yaml or package-lock.json, and the value of "lockfileVersion".

Corepack

The experiemental tool Corepack can be used after adding an Environment Variable with the name ENABLE_EXPERIMENTAL_COREPACK and value 1 to your Project followed by setting the packageManager property in the package.json file in the root of your repository.

Install Command

To update your Install Command, first navigate to your General tab in Project Settings. There, you should see your Build & Development Settings. Then, enable the Override toggle. Finally, update the Install Command input with your desired command, such as npx npm@7 install.

Adding a custom Install Command.
Adding a custom Install Command.

After you have saved your Build & Development Settings, you will need to redeploy or create a new Vercel Deployment to see the updated Build & Development Settings applied your deployments.

Couldn't find the guide you need?