Lerna Boostrap因NPM ERR失败!代码E401
每当我在Jenkins上运行Lerna Bootstrap时,它的失败就会出错,但会通过本地机器传递。
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
package.json在主文件夹上
"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"
}
运行命令
npm i
npm run bootstrap
npm i-通过,但“ npm run bootstrap”失败。
我尝试了多个选项,例如
- .npmrc in .NPMRC添加了my-repo的凭据
// my-repo-url:8081/nexus/repository/npm-repo/:_ password = ## base-64-64-base-64编码password ## // my-repo-url:8081/nexus/repository/npm-repo/:username = ## usernamr ##
in .npmrc _auth = ## base-64-engoded-sonded-soded-username-username-andame-andame-andame-andame-andame-password## #
中添加中,添加或删除” - always-auth = true”& lerna.json
中的“ npmclientargs”中的“ - 图片-SSL”
版本
- 节点v14.17.0
- npm 6.14.13
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
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##in added in .npmrc _auth=##base-64-encoded-username-and-password##
added or removed "--always-auth=true" & "--strict-ssl" from "npmClientArgs" in lerna.json
Versions
- node v14.17.0
- npm 6.14.13
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项#1
从.NPMRC复制_auth值,并在“ npmclientargs”中添加,
选项#2
Option#1
Copied _auth value from .npmrc and added in "npmClientArgs"
Option#2