bufferoverflow/verdaccio-gitlab

error: must have required permissions: at package-name

SangHakLee opened this issue · 3 comments

Error case

Publishing with the following command will result in an error.

$ npm publish --registry http://x.x.x.x:4873
npm notice
npm notice package: verdaccio-test@1.0.0
npm notice === Tarball Contents ===
npm notice 391B package.json
npm notice === Tarball Details ===
npm notice name:          verdaccio-test
npm notice version:       1.0.0
npm notice package size:  327 B
npm notice unpacked size: 391 B
npm notice shasum:        743fdeb588e7f189185a3f9a9781376eb93ea2c3
npm notice integrity:     sha512-Ybd/QdLjDdQwO[...]MemC8wGvNKjNA==
npm notice total files:   1
npm notice
npm ERR! publish Failed PUT 403
npm ERR! code E403
npm ERR! must have required permissions:  at package-name : verdaccio-test

npm ERR! A complete log of this run can be found in:

package.json

{
  "name": "verdaccio-test",
  "version": "1.0.0",
  "description": "",
  //...
}

verdaccio server log

 info <-- x.x.x.x requested 'PUT /verdaccio-test'
 trace--- [gitlab] authenticate called for user: leesanghak
 debug--- [gitlab] user: gm1702846 found in cache, authenticated with groups: { publish:
   [ 'leesanghak',
     'cloud',
     'Yokan-Study',
     'leesanghak/verdaccio-test',
     'Yokan-Study/nightwatch',
     ... // SKIP ] }

Success case

Based on the contents of publish, I thought that the package name should be included in the publish group.

  • leesanghak (gitlab username)
  • cloud (gitlab group name)
  • Yokan-Study (gitlab group name)

package.json

{
  "name": "leesanghak",
  "version": "1.0.0",
  "description": "",
  //...
}

Conclusion

However, what I want is to publish verdaccio-test(leesanghak/verdaccio-test), not leesanghak.

verdaccio-test seems to be getting an error because it belongs to a subgroup of my gitlab account leesanghak, how can I fix this?

you should be able to publish a scoped package @leesanghak/verdaccio-test but not verdaccio-test as you do not own that group.

Thanks, @bufferoverflow

I changed the package.json and published it as follows.

package.json

{
  "name": "@leesanghak/verdaccio-test",
  "version": "1.0.0",
  "description": "",
  //...
}

If you run npm init with the following command, the scoped package name will be automatically generated.

$ npm init --scope=@leesanghak

thanks for the feedback, closing this