[BUG] npmrc errors related to lacking authToken are obscure #3618
Labels
Bug
thing that needs fixing
Documentation
documentation related issue
Priority 2
secondary priority issue
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
This error has been reported before, but for different reasons. I was getting this error in my CI log,
With
-ddd
, I getMy problem was I was generating the line in npmrc with (expanded the CI variables),
When that second line should have been,
It's not clear me what the syntax of these lines should be -- I don't see it documneted -- but there are lots of guides on both GitHub and GitLab that have people manually writing
.npmrc
with these details. One of those guides said that if the token works for multiple repositories we can have it specified without the rest of the path; that the auth line was only left-anchored. That seems to be incorrect. It seems like if the error is the url in the top must match the url in the bottom exactly than a more desirable error (then pointing the user tonpm adduser
would be),This problem can even be created with minute problems in the registry that make it mismatch, like this may work with to pull down packages,
But it will throw the error above because you forgot the slash, it needs to be,
This is further annoying because GitLab currently publishes two variables which look like they can be used,
However these two variables can NOT be used together to create an
npmrc
.Because then the bottom
CI_REGISTRY
will expand to having the port number:5050
and trigger a warning.Note a lot of these issues would be impossible to create with a more sane npmrc format. I'll open up another issue for that.
Expected Behavior
An error more on the lines of,
Steps To Reproduce
npm publish
Environment
The text was updated successfully, but these errors were encountered: