{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/8217","labels_url":"https://api.github.com/repos/npm/npm/issues/8217/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/8217/comments","events_url":"https://api.github.com/repos/npm/npm/issues/8217/events","html_url":"https://github.com/npm/npm/issues/8217","id":74542294,"number":8217,"title":"Publishing scoped packages - authentication issues","user":{"login":"charlierudolph","id":1676758,"avatar_url":"https://avatars.githubusercontent.com/u/1676758?v=3","gravatar_id":"","url":"https://api.github.com/users/charlierudolph","html_url":"https://github.com/charlierudolph","followers_url":"https://api.github.com/users/charlierudolph/followers","following_url":"https://api.github.com/users/charlierudolph/following{/other_user}","gists_url":"https://api.github.com/users/charlierudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/charlierudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlierudolph/subscriptions","organizations_url":"https://api.github.com/users/charlierudolph/orgs","repos_url":"https://api.github.com/users/charlierudolph/repos","events_url":"https://api.github.com/users/charlierudolph/events{/privacy}","received_events_url":"https://api.github.com/users/charlierudolph/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-09T00:36:06Z","updated_at":"2015-05-09T03:13:56Z","closed_at":null,"body":"Was trying to publish a scoped package to a privately hosted npm registry and ran into a ENEEDAUTH.\r\nI thought my `.npmrc` would be sufficient in specifying the host with\r\n```\r\n@myorg:registry=http://my.host/\r\n```\r\nLooking at the silly level of logging, it appeared to correctly determine where to publish to without me setting the `publishConfig` in my `package.json`.\r\n\r\nHowever I just kept getting the error \r\n```\r\nnpm ERR! code ENEEDAUTH\r\n\r\nnpm ERR! need auth auth required for publishing\r\nnpm ERR! need auth You need to authorize this machine using `npm adduser`\r\n```\r\n\r\nI thought this was a permissions error with my host and it ended up being cause by this [code](https://github.com/npm/npm/blob/master/lib/config/get-credentials-by-uri.js), which ignored the `_auth` option I supplied because the scope registry and my publish config did not match. \r\n\r\nI originally wanted to ask for an warning / error message anytime my \"_auth\" token is thrown away (due to the uri and registry being different), but can now see where this would be harder to deal with due to global config. Overall I think just more documentation on scoped packages and how to properly deal with authentication would be very valuable."},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/100416408","html_url":"https://github.com/npm/npm/issues/8217#issuecomment-100416408","issue_url":"https://api.github.com/repos/npm/npm/issues/8217","id":100416408,"user":{"login":"smikes","id":5124609,"avatar_url":"https://avatars.githubusercontent.com/u/5124609?v=3","gravatar_id":"","url":"https://api.github.com/users/smikes","html_url":"https://github.com/smikes","followers_url":"https://api.github.com/users/smikes/followers","following_url":"https://api.github.com/users/smikes/following{/other_user}","gists_url":"https://api.github.com/users/smikes/gists{/gist_id}","starred_url":"https://api.github.com/users/smikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smikes/subscriptions","organizations_url":"https://api.github.com/users/smikes/orgs","repos_url":"https://api.github.com/users/smikes/repos","events_url":"https://api.github.com/users/smikes/events{/privacy}","received_events_url":"https://api.github.com/users/smikes/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T03:13:56Z","updated_at":"2015-05-09T03:13:56Z","body":"Thanks for reporting this."}}