`npm adduser` authentication error in NPM 6.4.1


(John Slegers) #1

I set up a private repo on Artifactory.
In NPM 3.x, I was able to create credentials for this, using the following command, starting from an empty ~/.npmrc :

npm adduser --registry=https://artifactory.luciad.com/artifactory/api/npm/product_release_npm --scope=@luciad --always-auth

When I try to run the exact same command in NPM 6.4.1, with the exact same credentials, for the exact same private repo with the exaxt same settings, also starting from an empty ~/.npmrc, I get the following error :

 npm ERR! code E404
npm ERR! 404 Registry returned 404 for PUT on https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers
npm ERR! 404
npm ERR! 404  'org.couchdb.user:jslegers' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404  1. name can only contain URL-friendly characters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jslegers.LUCIAD\AppData\Roaming\npm-cache\_logs\2019-01-30T16_00_02_039Z-debug.log

When I look at the log file, I see the following :

 6 http request → POST https://artifactory.luciad.com/artifactory/api/npm/-/v1/login
7 http 404 ← Not Found (https://artifactory.luciad.com/artifactory/api/npm/-/v1/login)
8 verbose web login not supported, trying couch
9 verbose login before first PUT { _id: 'org.couchdb.user:jslegers',
9 verbose login   name: 'jslegers',
9 verbose login   password: 'XXXXX',
9 verbose login   type: 'user',
9 verbose login   roles: [],
9 verbose login   date: '2019-01-30T16:00:02.008Z' }
10 http request → PUT https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers
11 http 404 ← Not Found (https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers)
12 verbose adduser before first PUT { _id: 'org.couchdb.user:jslegers',
12 verbose adduser   name: 'jslegers',
12 verbose adduser   password: 'XXXXX',
12 verbose adduser   email: 'john.slegers@hexagon.com',
12 verbose adduser   type: 'user',
12 verbose adduser   roles: [],
12 verbose adduser   date: '2019-01-30T16:00:02.024Z' }
13 http request → PUT https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers
14 http 404 ← Not Found (https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers)
15 verbose stack Error: Registry returned 404 for PUT on https://artifactory.luciad.com/artifactory/api/npm/-/user/org.couchdb.user:jslegers

And idea why npm adduser is failing here?

If I re-use the credentials I created with NPM 3.x, I’m able to publish without any problems using NPM 6.4.1, so it’s definitely not an authorization issue in Artifactory that is causing this.


(Lars Willighagen) #2

Note: if you’re posting in #bugs, please use the template in the future. This post seems pretty clear without but it’s the rules. I’m guessing you didn’t see it because you originally posted in #support?


(John Slegers) #3

Note: if you’re posting in #bugs, please use the template in the future. This post seems pretty clear without but it’s the rules.

I’m sorry. I’m new here.

Still getting used to the UI & procedures for this community.

I’ll keep this in mind.

Why on earth did you guys move away from Github for issue tracking? Pretty much everyone is familiar with how to use Github.

I’m guessing you didn’t see it because you originally posted in #support?

Correct.

I initially posted in in “support”, only to realize later that “bugs” is probably a better match.

So I never saw any template.


(Lars Willighagen) #4

No problem.

There has been quite some discussion about that (Request: move bugs back to GitHub.com. comes to mind). In the end this forum is definitely an improvement for regular users and the developers, given the “Latest” feed, better modding tools, categories (for which labels are a poor substitute), and that everything is centralized now (apart from the PRs). Also, it’s not just centralized, it’s also isolated: with this forum it’s easier to search across all npm support, bug reports and feature requests, without having to search through all of GitHub.

I see how most of that could be different or less relevant for people who report the occasional bug and don’t browse this forum weekly (or daily), but theoretically, a more organised forum for the people answering questions should also mean that questions get answered faster.


(John Slegers) #6

categories (for which labels are a poor substitute)

Personally, I find it confusing that there’s a separate “bugs” & “support” category. And especially for people new to a particular tech (the ones most likely to want to log an issue), it’s often not clear whether you’re encountering a bug or you’re just doing something wrong.

And first posting to “support” & moving to “bugs” if it turns out to be a bug doesn’t seem to be efficient either, with the lack of a template for “support”, as I discovered the hard way myself.

To distinguish between “support” & “bugs”, labels definitely make more sense to me than categories…

everything is centralized now (apart from the PRs)

From a core dev’s perspective maybe. But for a common user of NPM, the opposite is true.

If the code is on Github, it’s so much easier for common users to be able to log an issue & send push requests on the same platform with the same user and the same credentials.

IMHO, having to create a separate account on a different platform for just one particular project is likely to discourage many people from actually logging their issues or from creating their own PRs. I sure am less likely to do so, and I very much doubt I’m the exception here.

this forum it’s easier to search across all npm support, bug reports and feature requests, without having to search through all of GitHub.

Across different repos, you mean?

I guess it does kinda suck that Github doesn’t allow searching issues or across different repos of the same user. But is that really needed?

Wouldn’t moving all issue tracking for NPM-related sub-projects to the main NPM issue tracker for the main NPM repo on Github kinda sorta have the same advantage as moving to here… but without the downside of having to move to a different environment specific for NPM?

I don’t really see the need to search across multiple repos / issue trackers on Github, really.

theoretically, a more organised forum for the people answering questions should also mean that questions get answered faster.

Sure. It just strikes me as odd that moving to this place was considered the most efficient solution among different possible solutions.

But maybe that’s just me?

Either way, this discussion is waaaaaaay off-topic for the issue I logged, so I propose we either end this discussion here or move it elsewhere, where it’s less off-topic.


(Kat Marchán) #7

This seems like an Artifactory issue, not an npm bug.


(John Slegers) #8

This seems like an Artifactory issue, not an npm bug.

It works fine if I use NPM 3.10.10.

The version of Artifactory we’re using, is version 5.4.6, which according to the release notes was released in August 7, 2017.

Have there been any changes to the implementation of NPM’s adduser between v 3.10.10 since August 7, 2017 that could have broken compatibility with older versions of Artifactory?


(system) closed #9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.