{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/17231","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/17231/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/17231/comments","events_url":"https://api.github.com/repos/npm/npm/issues/17231/events","html_url":"https://github.com/npm/npm/issues/17231","id":236188211,"number":17231,"title":"Unable to publish with \"You must be logged in\" error","user":{"login":"guioconnor","id":35854,"avatar_url":"https://avatars0.githubusercontent.com/u/35854?v=3","gravatar_id":"","url":"https://api.github.com/users/guioconnor","html_url":"https://github.com/guioconnor","followers_url":"https://api.github.com/users/guioconnor/followers","following_url":"https://api.github.com/users/guioconnor/following{/other_user}","gists_url":"https://api.github.com/users/guioconnor/gists{/gist_id}","starred_url":"https://api.github.com/users/guioconnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guioconnor/subscriptions","organizations_url":"https://api.github.com/users/guioconnor/orgs","repos_url":"https://api.github.com/users/guioconnor/repos","events_url":"https://api.github.com/users/guioconnor/events{/privacy}","received_events_url":"https://api.github.com/users/guioconnor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-15T13:14:05Z","updated_at":"2017-06-17T02:59:55Z","closed_at":null,"body":"#### I'm opening this issue because:\r\n\r\n  - [ ] npm is crashing.\r\n  - [ ] npm is producing an incorrect install.\r\n  - [x] npm is doing something I don't understand.\r\n  - [ ] Other (_see below for feature requests_):\r\n\r\n#### What's going wrong?\r\n\r\nI receive and error when publishing org packages saying I'm not logged in, but I can publish my own (non-scoped) packages under my user.\r\n\r\nAfter several successful publications of the package, it suddenly stopped working when we created a new user and added to the org and removed the user that previously published. The user I'm logged in as in the log below is owner and has read/write access to the package. (and is neither the user that was removed nor the newly created)\r\n\r\nThe problem happens simultaneously on my own dev machine and the CI environment. At a glance it seems a poorly reported permissions error but I don't know what the problem may be.\r\n\r\n\r\n#### How can the CLI team reproduce the problem?\r\n\r\nI'm not sure how, in my environment I can reproduce it by\r\n1) `npm login` to my account\r\n2) `npm publish` a personal (non-scoped) package, which is successful\r\n3) `npm publish` my org's private package, which fails with as per the log below.\r\n\r\n```\r\n$ npm login\r\nUsername: guioconnor\r\nPassword:\r\nEmail: (this IS public) [~redacted~]\r\nLogged in as guioconnor on https://registry.npmjs.org/.\r\n```\r\n```\r\n$ cd [~my personal package~]\r\n$ npm publish # personal package\r\n+ ebg13@1.3.5\r\n```\r\n```\r\n$ cd [~my org package~]\r\n$ npm publish\r\nnpm ERR! publish Failed PUT 401\r\nnpm ERR! code E401\r\nnpm ERR! You must be logged in to publish packages : @[~myOrg~]/[~myPackage~]\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     /Users/guioconnor/.npm/_logs/2017-06-15T12_58_37_378Z-debug.log\r\n```\r\n\r\nI've redacted info about users/orgs/package names but otherwise a verbatim log.\r\n\r\n\r\n### supporting information:\r\n\r\n - `npm -v` prints:\r\n5.0.3 (but I have tried with different versions as well)\r\n - `node -v` prints:\r\nv8.0.0 (but I have tried with different versions as well)\r\n - `npm config get registry` prints:\r\nhttps://registry.npmjs.org/\r\n - Windows, OS X/macOS, or Linux?:\r\nMacOs on my local machine & Linux on CI server\r\n - Network issues:\r\n   - Geographic location where npm was run:\r\n   - [ ] I use a proxy to connect to the npm registry.\r\n   - [ ] I use a proxy to connect to the web.\r\n   - [ ] I use a proxy when downloading Git repos.\r\n   - [ ] I access the npm registry via a VPN\r\n   - [ ] I don't use a proxy, but have limited or unreliable internet access.\r\n - Container:\r\n   - [ ] I develop using Vagrant on Windows.\r\n   - [ ] I develop using Vagrant on OS X or Linux.\r\n   - [ ] I develop / deploy using Docker.\r\n   - [ ] I deploy to a PaaS (Triton, Heroku).\r\n\r\n<!--\r\n    Thank you for contributing to npm! Please review this checklist\r\n    before submitting your issue.\r\n\r\n    - Please check if there's a solution in the troubleshooting wiki:\r\n      https://github.com/npm/npm/blob/latest/TROUBLESHOOTING.md\r\n\r\n    - Also ensure that your new issue conforms to npm's contribution guidelines:\r\n      https://github.com/npm/npm/blob/latest/CONTRIBUTING.md\r\n\r\n    - Participation in this open source project is subject to the npm Code of Conduct:\r\n      https://www.npmjs.com/policies/conduct\r\n\r\n    For feature requests, delete the above and uncomment the section following this one. But first, review the existing feature requests\r\n    and make sure there isn't one that already describes the feature\r\n    you'd like to see added:\r\n      https://github.com/npm/npm/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+label%3Aalready-looked-at\r\n-->\r\n\r\n<!--\r\n\r\n#### What's the feature?\r\n\r\n#### What problem is the feature intended to solve?\r\n\r\n#### Is the absence of this feature blocking you or your team? If so, how?\r\n\r\n#### Is this feature similar to an existing feature in another tool?\r\n\r\n#### Is this a feature you're prepared to implement, with support from the npm CLI team?\r\n\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/309188887","html_url":"https://github.com/npm/npm/issues/17231#issuecomment-309188887","issue_url":"https://api.github.com/repos/npm/npm/issues/17231","id":309188887,"user":{"login":"tz5514","id":6021943,"avatar_url":"https://avatars2.githubusercontent.com/u/6021943?v=3","gravatar_id":"","url":"https://api.github.com/users/tz5514","html_url":"https://github.com/tz5514","followers_url":"https://api.github.com/users/tz5514/followers","following_url":"https://api.github.com/users/tz5514/following{/other_user}","gists_url":"https://api.github.com/users/tz5514/gists{/gist_id}","starred_url":"https://api.github.com/users/tz5514/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tz5514/subscriptions","organizations_url":"https://api.github.com/users/tz5514/orgs","repos_url":"https://api.github.com/users/tz5514/repos","events_url":"https://api.github.com/users/tz5514/events{/privacy}","received_events_url":"https://api.github.com/users/tz5514/received_events","type":"User","site_admin":false},"created_at":"2017-06-17T02:59:55Z","updated_at":"2017-06-17T02:59:55Z","body":"+1, same issue."}}
{"actor":{"display_login":"tz5514"}}