npm / registry-issue-archive

An archive of the old npm registry issue tracker
https://npm.community
249 stars 47 forks source link

Error when adding / removing package owner #295

Closed dannynelson closed 6 years ago

dannynelson commented 6 years ago

Hi, I am trying to add the owner passfort-dev to the json-schema-to-flow-type package.

When I attempt to add the owner from the UI, I receive this error:

error adding collaborator to package 'json-schema-to-flow-type': user not found in org)

When I run npm owner add passfort-dev using the CLI when logged in as dannynelson, I see this error log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/dannynelson/.nodenv/versions/6.9.1/bin/node',
1 verbose cli   '/Users/dannynelson/.nodenv/versions/6.9.1/bin/npm',
1 verbose cli   'owner',
1 verbose cli   'add',
1 verbose cli   'passfort-dev' ]
2 info using npm@5.7.1
3 info using node@v6.9.1
4 verbose owner add passfort-dev to json-schema-to-flow-type
5 silly mapToRegistry name -/user/org.couchdb.user:passfort-dev
6 silly mapToRegistry using default registry
7 silly mapToRegistry registry https://registry.npmjs.org/
8 silly mapToRegistry data { type: 'directory',
8 silly mapToRegistry   registry: undefined,
8 silly mapToRegistry   where: '/Users/dannynelson/Projects/json-schema-to-flow-type',
8 silly mapToRegistry   raw: '-/user/org.couchdb.user:passfort-dev',
8 silly mapToRegistry   name: undefined,
8 silly mapToRegistry   escapedName: undefined,
8 silly mapToRegistry   scope: undefined,
8 silly mapToRegistry   rawSpec: '-/user/org.couchdb.user:passfort-dev',
8 silly mapToRegistry   saveSpec: 'file:-/user/org.couchdb.user:passfort-dev',
8 silly mapToRegistry   fetchSpec: '/Users/dannynelson/Projects/json-schema-to-flow-type/-/user/org.couchdb.user:passfort-dev',
8 silly mapToRegistry   gitRange: undefined,
8 silly mapToRegistry   gitCommittish: undefined,
8 silly mapToRegistry   hosted: undefined }
9 silly mapToRegistry uri https://registry.npmjs.org/-/user/org.couchdb.user:passfort-dev
10 verbose request uri https://registry.npmjs.org/-/user/org.couchdb.user:passfort-dev
11 verbose request new user, so can't send auth
12 info attempt registry request try #1 at 10:05:47 PM
13 verbose request using bearer token for auth
14 verbose request id 6274d01c1e59faa1
15 http request GET https://registry.npmjs.org/-/user/org.couchdb.user:passfort-dev
16 http 200 https://registry.npmjs.org/-/user/org.couchdb.user:passfort-dev
17 verbose headers { 'content-type': 'application/json',
17 verbose headers   'content-encoding': 'gzip',
17 verbose headers   'cache-control': 'max-age=300',
17 verbose headers   'transfer-encoding': 'chunked',
17 verbose headers   'accept-ranges': 'bytes',
17 verbose headers   date: 'Mon, 19 Mar 2018 05:05:48 GMT',
17 verbose headers   via: '1.1 varnish',
17 verbose headers   connection: 'keep-alive',
17 verbose headers   'x-served-by': 'cache-pao17431-PAO',
17 verbose headers   'x-cache': 'MISS',
17 verbose headers   'x-cache-hits': '0',
17 verbose headers   'x-timer': 'S1521435948.862497,VS0,VE147',
17 verbose headers   vary: 'Accept-Encoding, Accept' }
18 silly mapToRegistry name json-schema-to-flow-type
19 silly mapToRegistry using default registry
20 silly mapToRegistry registry https://registry.npmjs.org/
21 silly mapToRegistry data { type: 'tag',
21 silly mapToRegistry   registry: true,
21 silly mapToRegistry   where: undefined,
21 silly mapToRegistry   raw: 'json-schema-to-flow-type',
21 silly mapToRegistry   name: 'json-schema-to-flow-type',
21 silly mapToRegistry   escapedName: 'json-schema-to-flow-type',
21 silly mapToRegistry   scope: undefined,
21 silly mapToRegistry   rawSpec: '',
21 silly mapToRegistry   saveSpec: null,
21 silly mapToRegistry   fetchSpec: 'latest',
21 silly mapToRegistry   gitRange: undefined,
21 silly mapToRegistry   gitCommittish: undefined,
21 silly mapToRegistry   hosted: undefined }
22 silly mapToRegistry uri https://registry.npmjs.org/json-schema-to-flow-type
23 verbose request uri https://registry.npmjs.org/json-schema-to-flow-type
24 verbose request no auth needed
25 info attempt registry request try #1 at 10:05:48 PM
26 verbose request using bearer token for auth
27 http request GET https://registry.npmjs.org/json-schema-to-flow-type
28 http 200 https://registry.npmjs.org/json-schema-to-flow-type
29 verbose headers { 'content-type': 'application/json; charset=UTF-8',
29 verbose headers   server: 'UploadServer',
29 verbose headers   'cache-control': 'max-age=300',
29 verbose headers   'last-modified': 'Thu, 15 Mar 2018 3:27:00 GMT',
29 verbose headers   etag: '"5aa9e804-6f74"',
29 verbose headers   'x-npm-region': 'US-West',
29 verbose headers   'content-encoding': 'gzip',
29 verbose headers   'content-length': '3549',
29 verbose headers   'accept-ranges': 'bytes',
29 verbose headers   date: 'Mon, 19 Mar 2018 05:05:48 GMT',
29 verbose headers   via: '1.1 varnish',
29 verbose headers   age: '1137',
29 verbose headers   connection: 'keep-alive',
29 verbose headers   'x-served-by': 'cache-pao17431-PAO',
29 verbose headers   'x-cache': 'HIT',
29 verbose headers   'x-cache-hits': '1',
29 verbose headers   'x-timer': 'S1521435948.034138,VS0,VE1',
29 verbose headers   vary: 'Accept-Encoding, Accept' }
30 silly mapToRegistry name json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba
31 silly mapToRegistry using default registry
32 silly mapToRegistry registry https://registry.npmjs.org/
33 silly mapToRegistry data { type: 'directory',
33 silly mapToRegistry   registry: undefined,
33 silly mapToRegistry   where: '/Users/dannynelson/Projects/json-schema-to-flow-type',
33 silly mapToRegistry   raw: 'json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba',
33 silly mapToRegistry   name: undefined,
33 silly mapToRegistry   escapedName: undefined,
33 silly mapToRegistry   scope: undefined,
33 silly mapToRegistry   rawSpec: 'json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba',
33 silly mapToRegistry   saveSpec: 'file:json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba',
33 silly mapToRegistry   fetchSpec: '/Users/dannynelson/Projects/json-schema-to-flow-type/json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba',
33 silly mapToRegistry   gitRange: undefined,
33 silly mapToRegistry   gitCommittish: undefined,
33 silly mapToRegistry   hosted: undefined }
34 silly mapToRegistry uri https://registry.npmjs.org/json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba
35 verbose request uri https://registry.npmjs.org/json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba
36 verbose request sending authorization for write operation
37 info attempt registry request try #1 at 10:05:48 PM
38 verbose request using bearer token for auth
39 http request PUT https://registry.npmjs.org/json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba
40 http 404 https://registry.npmjs.org/json-schema-to-flow-type/-rev/18-6c21919199c02b8c137b2ff32ee2cdba
41 verbose headers { 'content-type': 'application/json',
41 verbose headers   'cache-control': 'max-age=0',
41 verbose headers   'content-length': '42',
41 verbose headers   'accept-ranges': 'bytes',
41 verbose headers   date: 'Mon, 19 Mar 2018 05:05:48 GMT',
41 verbose headers   via: '1.1 varnish',
41 verbose headers   connection: 'keep-alive',
41 verbose headers   'x-served-by': 'cache-pao17431-PAO',
41 verbose headers   'x-cache': 'MISS',
41 verbose headers   'x-cache-hits': '0',
41 verbose headers   'x-timer': 'S1521435948.056610,VS0,VE231' }
42 error owner mutate Failed to update package metadata
43 verbose stack Error: Team not found : 18-6c21919199c02b8c137b2ff32ee2cdba
43 verbose stack     at makeError (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:314:12)
43 verbose stack     at RegClient.<anonymous> (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:14)
43 verbose stack     at Request._callback (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
43 verbose stack     at Request.self.callback (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/request/request.js:186:22)
43 verbose stack     at emitTwo (events.js:106:13)
43 verbose stack     at Request.emit (events.js:191:7)
43 verbose stack     at Request.<anonymous> (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/request/request.js:1163:10)
43 verbose stack     at emitOne (events.js:96:13)
43 verbose stack     at Request.emit (events.js:188:7)
43 verbose stack     at IncomingMessage.<anonymous> (/Users/dannynelson/.nodenv/versions/6.9.1/lib/node_modules/npm/node_modules/request/request.js:1085:12)
44 verbose statusCode 404
45 verbose pkgid 18-6c21919199c02b8c137b2ff32ee2cdba
46 verbose cwd /Users/dannynelson/Projects/json-schema-to-flow-type
47 verbose Darwin 17.3.0
48 verbose argv "/Users/dannynelson/.nodenv/versions/6.9.1/bin/node" "/Users/dannynelson/.nodenv/versions/6.9.1/bin/npm" "owner" "add" "passfort-dev"
49 verbose node v6.9.1
50 verbose npm  v5.7.1
51 error code E404
52 error 404 Team not found : 18-6c21919199c02b8c137b2ff32ee2cdba
53 error 404
54 error 404 '18-6c21919199c02b8c137b2ff32ee2cdba' is not in the npm registry.
55 error 404 You should bug the author to publish it (or use the name yourself!)
56 error 404 Note that you can also install from a
57 error 404 tarball, folder, http url, or git url.
58 verbose exit [ 1, true ]

I tried using an earlier version of npm (3.x) and saw a similar error. I also see an error when trying to remove owners from this package. However, I am able to add/remove owners from my other packages without issues.

Thank you for your help!

dannynelson commented 6 years ago

NPM support changed the package ownership scope from an organization to an individual user to resolve my issue:

With public packages owned by individual users, you can add collaborators to packages. But if a package is owned by an organization (even if a free org), you'll have to add the user to your org in order for them to access the package. Ultimately, organizations have access permissions that differ from individual user profiles.