Lerna bootstrap fails with a 401 in CI with a nexus repository
See original GitHub issueHello ! Thanks for the good work, lerna’s been a breeze for us, except in my corporate CI configuration aha.
So we’re having trouble with a simple lerna bootstrap
when run in Jenkins CI.
Context
We’re using a custom nexus repository where the following configuration works locally on our posts :
lerna.json
{
"npmClient": "npm",
"packages": [
"packages/*"
],
"version": "0.5.0"
}
package.json
{
"name": "rator",
"scripts": {
"postinstall": "lerna bootstrap",
"build": "lerna run build",
"test": "lerna run test"
},
"dependencies": {
"lerna": "^3.19.0"
}
}
.npmrc in CI
email = xxx@example.com
registry = https://custom-repo.fr/repository/our-group
always-auth = true
_auth = xxxx
I use the same repository on my machine but it works. I guess it has something to do with the always auth.
But, when run on CI, npm install
works normally and then lerna bootstrap, (or lerna exec 'npm i'
) prints this error on the first package it tries to bootstrap :
17:48:01 npm ERR! code E401
17:48:01 npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
Your Environment
Executable | Version |
---|---|
lerna --version |
3.19.0 |
npm --version |
6.11.3 |
node --version |
10.16.0 |
OS | Version |
---|---|
Ubuntu | 16.10 |
Questions
I am not really sure it’s something in lerna, my guess is that I may have to configure something differently, like making lerna use the _auth config in my npmrc but I didn’t find anything working for the last day.
I’ll be doing repeated npm installs and publish in the meanwhile 😕
Thanks in advance 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
Had same issue. Some workaround is put: //custom-repo.fr/repository/our-group:_auth = xxxx
into npmrc.
node-fetch-registry package don’t get _auth key in some reason. It happend while pacote request manifest method.
Hi Folks 👋
Please take a look at our published roadmap for Lerna v7 here: https://github.com/lerna/lerna/discussions/3410
One of the key items covered at length on there (please do read it for full context) is that now that we find ourselves in late 2022, it no longer makes sense for lerna to supplement package management concerns (such as installation, boostrapping, linking etc) which are covered reliably for monorepo workspaces by the three main package managers: npm, yarn and pnpm.
lerna bootstrap
et al were developed in completely different era of the JavaScript ecosystem.If you have any specific concerns please do join in on that discussion, and provide as much context as possible.
Many thanks 🙏