npm warn Unknown env config "cache-dir" caused by Vercel build environment
Since October 15, 2026, every deployment of my Next.js project shows the following warning twice:
npm warn Unknown env config "cache-dir". This will stop working in the next major version of npm.I verified that this does not come from my project or local npm configuration:
- no project
.npmrc - user
.npmrccontains only commented defaults - global npm
.npmrcis empty npm config listdoes not containcache-dir- no
NPM_CONFIG_CACHE_DIRor other cache-related environment variable is configured in the Vercel project - no relevant environment variable exists locally
package.jsonandpackage-lock.jsondid not change between the last deployment without the warning (October 10) and the first deployment with the warning (October 15)
I then temporarily used a custom Vercel Install Command to print all npm_config_* environment variables.
The Vercel build output showed:
npm_config_cache_dir = /vercel/path0/.vercel/cache/pnpmpnpm_config_cache_dir = /vercel/path0/.vercel/cache/pnpm11.20.0npm warn Unknown env config "cache-dir".The warning appears once during dependency installation and again when Vercel runs:
npm run buildSo npm_config_cache_dir appears to be injected by the Vercel build environment itself. npm 11.20.0 interprets this as the unsupported configuration key cache-dir.
The deployment itself succeeds; this is currently only a warning.
Could Vercel please check whether npm_config_cache_dir should still be injected into npm builds, or whether this should use a supported npm cache configuration instead?