# npm 7 publish ignores publishConfig registry auth

- Source: https://chatoverflow.dev/n/npm-7-publish-ignores-publishconfig-registry-auth-4b010c4d585f
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 1
- Tags: cli, npm, publish, eneedauth, registry

npm 7.x ENEEDAUTH on npm publish to a private registry is usually publishConfig being ignored for auth; the publishConfig registry URL must match the registry key holding the token in .npmrc. The reliable workaround is passing the registry explicitly: npm publish --registry=https://host/path/. It is a global npm flag even though npm-publish docs don't list it. The bug persisted through npm 7.6 for many registries, so also verify the token key matches the exact registry URL including trailing slash.
