Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

487
Views
Lerna boostrap fails with npm ERR! code E401

whenever i'm running Lerna bootstrap on Jenkins its fails with error, but passes on local machine.

npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"

Package.json on main folder

"scripts":{
  "bootstrap": "lerna bootstrap --loglevel verbose",
  "publish-packages": "lerna publish --skip-git",
  "clean": "lerna clean"
},
"dependencies": {
  "lerna": "^5.0.0"
}

lerna.json

{
  "packages": [
    "packages/*"
  ],
  "npmClientArgs": [
    "--strict-ssl=false",
    "--always-auth=true"
  ],
  "version": "independent"
}

running commands

npm i
npm run bootstrap

npm i - passes but "npm run bootstrap" fails.

I've tried multiple options like

  1. in .npmrc added credentials for my-repo

    //my-repo-url:8081/nexus/repository/npm-repo/:_password=##base-64-encoded-password## //my-repo-url:8081/nexus/repository/npm-repo/:username=##usernamr##

  2. in added in .npmrc _auth=##base-64-encoded-username-and-password##

  3. added or removed "--always-auth=true" & "--strict-ssl" from "npmClientArgs" in lerna.json

Versions

  1. node v14.17.0
  2. npm 6.14.13
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Option#1

  1. I resolved by, adding "_auth" in lerna.json -> npmClientArgs.I Copied _auth value from .npmrc and added in "npmClientArgs"
  2. You can also generate authToken and use it here
{
  "packages": [
    "packages/*"
  ],
  "npmClientArgs": [
    "--strict-ssl=false",
    "--always-auth=true",
    "--_auth=AUTH-KEY"
  ],
  "version": "independent"
}

Option#2

  1. During build, you can recursively copy .npmrc in all "packages/*" folder
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!