question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: how do i publish a package

See original GitHub issue

Hi,

I have a group on gitlab.com and my verdaccio is configured but i got a access denied when trying to publish a package.

This is my configuration:

    packages:
      '@*/*':
        # scoped packages
        access: $authenticated
        publish: $authenticated
        proxy: npmjs
        gitlab: true

      '**':
        access: $authenticated
        publish: $authenticated
        proxy: npmjs
        gitlab: true

I successfully logged in with npm adduser --registry <url-here> after that i changed my package name to @GroupName/package-name but when i want to publish it to the registry i got a access denied. user username is not allowed to publish package @GroupName/package-name : @GroupName/package-name

Logs:

 debug--- [gitlab] user found in cache: username authenticated, with groups: username,GroupName
 debug--- [gitlab] user: username denied from publishing package: @GroupName/package-name

So the question is what do i wrong? or is this kind of a bug? also my group name is case sensitive maybe thats the problemen same of the username authentication?

Hope you guys have some ideas 😉

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
dlouzancommented, Jul 23, 2018

Mmm nope, false alarm on my side. I was able to push, with a mix of uppercase / lowercase. Just be sure, I used user as name and GroupName as group. Then I modified my local package.json to use the group and tried to publish, no issues (don’t mind the extra log messages, I modified them a bit in my local env):

 info <-- 127.0.0.1 requested 'PUT /@GroupName%2fverdaccio-gitlab'
 trace--- [gitlab] authenticate called for user: user
 debug--- [gitlab] user: user found in cache, authenticated with groups: user,GroupName
 trace--- [gitlab] publish: checking group: user for user: user and package: @GroupName/verdaccio-gitlab
 trace--- [gitlab] publish: checking group: GroupName for user: user and package: @GroupName/verdaccio-gitlab
 debug--- [gitlab] user: user allowed to publish package: @GroupName/verdaccio-gitlab as owner of package-scope
 info --> making request: 'GET https://registry.npmjs.org/@GroupName%2Fverdaccio-gitlab'
 http --> 404, req: 'GET https://registry.npmjs.org/@GroupName%2Fverdaccio-gitlab' (streaming)
 http --> 404, req: 'GET https://registry.npmjs.org/@GroupName%2Fverdaccio-gitlab', bytes: 0/21
 http <-- 201, user: user(127.0.0.1), req: 'PUT /@GroupName%2fverdaccio-gitlab', bytes: 23945/53
0reactions
LennardWesterveldcommented, Jul 23, 2018

Found the problem! my Kubernetes setup resolves the variables in the config file (ConfigMap). Sorry for that, thanks for checking @dlouzan!, the issue with the username still stands btw but thats already mentioned in #20.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to publish packages to npm (the way the industry does ...
Next, you want to begin the project with the npm init command. npm init. This command runs you through a few questions and...
Read more >
Publishing a Package - Yarn
When you publish a package with Yarn it goes onto the npm registry which is used to distribute packages globally.
Read more >
How To: Publishing Your First Package to npm - DigitalOcean
Here's a little guide for publishing your own packages on npm. You've written some piece of software code that you think is really...
Read more >
How to Publish Your First npm Package | by Bret Cameron
Once you're up-and-running, publishing an npm package can be as easy as typing npm publish into the terminal. But setting up your package...
Read more >
How To Create and Publish NPM Packages - James Q Quick
Ever wondered how to create and publish NPM packages that millions of JavaScript developers across the world can use?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found