Lerna 401 error when publishing to a private repo
See original GitHub issueExpected Behavior
Runing using Jenkins :
lerna publish --yes --canary minor
Should publish my packages to the provided private registry.
Current Behavior
Throws error:
18:55:35 lerna notice Skipping all user and access validation due to third-party registry
18:55:35 lerna notice Make sure you're authenticated properly ¯\_(ツ)_/¯
18:55:35 lerna http fetch PUT 401 85ms
18:55:35 lerna ERR! E401 Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
Possible Solution
I tried :
1/ in lerna.json
"command": {
"publish": {
"npmClient": "npm",
"verifyAccess": false,
"ignoreChanges": []
}
}
2/ --no-verify-access
3/ add .npmrc (it is ignored).
Your Environment
Executable | Version |
---|---|
lerna --version | 3.19.0 |
npm --version | 6.4.1 |
node --version | 10.14.1 |
Any help please ?
How can I setup authentication using lerna ?
Is there equivalent to npm options --globalconfig ${pp.env.GLOBAL_NPM_CONFIG} --color=always and --userconfig ${pp.env.NPM_CONFIG} using lerna ?
thanks 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:28
Top Results From Across the Web
Cannot publish to github package registry from travis
Everything seems to work fine (build and tests succeed), but when it tries to publish, I'm getting a 401 error. I've added my...
Read more >basic realm="sonatype nexus repository manager"
npm error E401: Unable to authenticate, need: BASIC realm="Sonatype Nexus ... Authentication error on publishing to private NPM repository on Nexus.
Read more >Creating and publishing your first GitHub private package ...
I will use my monorepo-test private git repository, and private ... Lerna publish throws 401 error if both doesn't match with no error...
Read more >NPM Publish returns error 400 - GitLab Forum
I created a test repo to try publishing private NPM packages. I wanted to try it with Lerna first, that's why the project...
Read more >How to troubleshoot NPM problems
How to troubleshoot NPM problems ; 401: Authentication issue, meaning the user did not use the right username / password ; 403: Authorization...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Additional info for researchers. In a case when multiple packages are publishing from GitHub Actions, the
YAML
should provide env variables with tokens. I found a good example. With the 401 error, these lines helped me (from the example).Many thanks to the repo author and to the authors of this thread 🙏🏻
@helabenkhalfallah, try this official GitHub guidelines.
My problem was caused by—
.npmrc
, where I specified custom registry URL without my GitHub name, andpackage.json
files missedrepository
field. E.g.,github:<your-github-name>/<your-repo>