Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login to private registry fails (Verdaccio, Nexus, …) #420

Open
kapooostin opened this issue May 28, 2019 · 8 comments
Open

Login to private registry fails (Verdaccio, Nexus, …) #420

kapooostin opened this issue May 28, 2019 · 8 comments

Comments

@kapooostin
Copy link

kapooostin commented May 28, 2019

Description

np fails to publish package due to login error:

? This scoped repo @scope/pkg hasn't been published. Do you want to publish it publicly? Yes

  ❯ Prerequisite check
    ↓ Ping npm registry [skipped]
    ✔ Check npm version
    ✔ Check yarn version
    ✖ Verify user is authenticated
      → You must be logged in. Use `npm login` and try again.

Yet I did login beforehand and both npm publish and yarn publish succeeded without any hitch. np also fails to ensure that my repo has been published because it has been more than once.

Steps to reproduce

I'm trying to publish a scoped package to Gemfury.io.

Expected behavior

np should use credentials npm and yarn use to login to my custom registry.

Environment

Node.js - 10.15.3 (via n)
npm - 6.9.0
yarn - 1.16.0
Git - 2.21.0
OS - OSX 10.14.4

@kapooostin kapooostin changed the title Login to private repository fails Login to private registry fails May 28, 2019
@brmscheiner
Copy link

I'm having the same problem. In package.json I have the following config:

  "np": {
    "contents": "lib"
  },

@brmscheiner
Copy link

Actually @kapooostin I found a solution based on #256. yarn login didn't work as suggested in the thread, but using npm run release instead of yarn release did the trick.

(in my package.json I have a release script: ./node_modules/.bin/np --yolo)

@kapooostin
Copy link
Author

I guess, this is the reason behind the issue sindresorhus/npm-name#31

@bavarianbytes
Copy link

It also doesn't work for me. Even with --yolo. I have a private repo without where i don't need to login (internal network).

package.json has:

"publishConfig": {
    "registry": "http://myinternalhost:8083/repository/npm/"
},

.npmrc has:

@myscope:registry=http://myinternalhost:8083/repository/npm/

Result:

    ✖ Verify user is authenticated
      → You must be logged in. Use `npm login` and try again.

Any ideas?

@jnv
Copy link

jnv commented Jan 6, 2021

Same issue here. We use Nexus Repository for internal packages which is a bit selective about features they implement from npm's API, so request to /collaborators fails with Bad Request error.

One very terrible hack is to bypass authentication by setting env variable NODE_ENV=test: NODE_ENV=test np.

Perhaps there could be an env variable or CLI/config option to skip authentication.

@slhck
Copy link
Contributor

slhck commented Feb 3, 2023

@fregante After looking at all those issues, what would you suggest to fix the problem? Seems like a skip of the collaborators resource (and not failing) would be simple enough. PRs welcome for adding this?

@fregante
Copy link
Collaborator

fregante commented Feb 3, 2023

Given the age of this issue I'd say support isn't a priority, but mostly the issue is #320

I don't know what the consequences of "just ignore the collaborators check" would be. It sounds like if it's there it shouldn't just be ignored.

Given the shortage of collaborators here, I suggest lobbying those vendors instead, which are paid (in the case of Nexus). Particularly for stuff like #519 (comment)

@slhck
Copy link
Contributor

slhck commented Feb 3, 2023

if it's there it shouldn't just be ignored

Seems like npm does just fine without it on third-party registries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants