[英]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.每当我在 Jenkins 上运行 Lerna 引导程序时,它都会因错误而失败,但会在本地机器上传递。
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
Package.json on main folder主文件夹上的 Package.json
"scripts":{
"bootstrap": "lerna bootstrap --loglevel verbose",
"publish-packages": "lerna publish --skip-git",
"clean": "lerna clean"
},
"dependencies": {
"lerna": "^5.0.0"
}
lerna.json 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. npm i - 通过但“npm run bootstrap”失败。
I've tried multiple options like我尝试了多种选择,例如
in .npmrc added credentials for my-repo在 .npmrc 中为 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##
//my-repo-url:8081/nexus/repository/npm-repo/:_password=##base-64-encoded-password## //my-repo-url:8081/nexus/repository/npm-repo/ :username=##usernamr##
in added in .npmrc _auth=##base-64-encoded-username-and-password##在 .npmrc 中添加 _auth=##base-64-encoded-username-and-password##
added or removed "--always-auth=true" & "--strict-ssl" from "npmClientArgs" in lerna.json在 lerna.json 的“npmClientArgs”中添加或删除“--always-auth=true”和“--strict-ssl”
Versions版本
Option#1选项1
{ "packages": [ "packages/*" ], "npmClientArgs": [ "--strict-ssl=false", "--always-auth=true", "--_auth=AUTH-KEY" ], "version": "independent" }
Option#2选项#2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.