Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    npm publish is unauthorized

    Scheduled Pinned Locked Moved Support
    2 Posts 2 Posters 15 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      david.osborne_4674
      last edited by

      Hello.

      Despite following the instructions here, I get a 401 error when trying to publish an NPM package using an API key. Is this possible?

      Kind regards,

      David.

      1 Reply Last reply Reply Quote 0
      • rhessingerR Offline
        rhessinger inedo-engineer
        last edited by

        Hi @david-osborne_4674,

        Are you able to pull successfully using npm and ProGet? Also, does your API Key have the Feed API right enabled or if you are impersonating a user, does that user have the ability to publish packages?

        Also, when you set your NPM auth using:

        [~]$ npm config set always-auth=true
        [~]$ npm config set _auth={ENCODEDAPIKEY}
        

        Are you base64 encoding your API Key using the format api:{APIKEY}. For example:

        If my API key is FakeApiKey, I would want to base 64 encode api:FakeApiKey would be YXBpOkZha2VBcGlLZXk=. So the commands to run would be:

        [~]$ npm config set always-auth=true
        [~]$ npm config set _auth=YXBpOkZha2VBcGlLZXk=
        

        Alternatively, you could use npm adduser to login. Here are some examples:

        If you ran the command to make ProGet your default repo: npm adduser --always-auth
        If you are using multiple repos: npm adduser --registry=http://progetrepo/feedname --always-auth
        If you are using scoped repos: npm adduser --registry=http://progetrepo/feedname --scope=@inedo --always-auth

        This way uses a username and password. If you want to use an API key, use API as the username as the API Key as the password.

        Hope this helps!

        Thanks,
        Rich

        Products Engineer, Inedo

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation