pnpm stops silently falling back to npmjs when an env var is unset
pnpm 11.28.12 and 12.21.0 make an unexpanded ${VAR} placeholder in a registry URL fail the install, instead of quietly resolving packages from the public registry.
pnpm shipped 11.28.12 and 12.21.0 on 13 November with a fix for how it handles unresolved environment variables in registry URLs. A ${VAR} placeholder left in a registry URL inside pnpm-workspace.yaml or a project’s .npmrc now fails the install outright.
Previously pnpm didn’t expand ${VAR} in those files at all. If the variable was never substituted, pnpm quietly skipped the broken URL and resolved packages from whatever registry it fell back to, including the public npmjs.org. That is the exact shape of a dependency confusion risk: a project meant to pull packages from a private, scoped registry could silently start pulling the same package names from the public one instead. pnpm now also warns when it ignores a placeholder in proxy, pnprServer or userAgent settings.
# pnpm-workspace.yaml
registry: "https://registry.example.com/${REGISTRY_TOKEN}/"
Why it matters: if your CI or local setup injects a token into a private registry URL this way, a missing or misnamed environment variable used to fail silently towards the public registry. Now it fails the command instead, so a broken secret shows up as a build error rather than as packages quietly coming from somewhere else.