gpt4 book ai didi

shell - Jenkins 失败: a terminal is required to read the password; either use the -S option to read from standard input

转载 作者:行者123 更新时间:2023-12-03 07:59:36 39 4
gpt4 key购买 nike

在 Jenkins 构建时,它在控制台输出上给出错误,例如:

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

如何解决这种情况?


configure中的Execute Shell中有这样一条命令:

sudo pnpm run build
sudo kill -9 $(sudo lsof -t -i:3000)

输出:

16:42:03  > git config core.sparsecheckout # timeout=10
16:42:03 > git checkout -f 9998780d6a154bab01b4c010616f25a6f018d80c # timeout=10
16:42:03 Commit message: "fix swr"
16:42:03 > git rev-list --no-walk 9998780d6a154bab01b4c010616f25a6f018d80c # timeout=10
16:42:04 [ProjectReact] $ /bin/sh -xe /tmp/jenkins14253074063433648143.sh
16:42:04 + sudo pnpm run build
16:42:04 sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
16:42:04 Build step 'Execute shell' marked build as failure
16:42:04 Finished: FAILURE

如果我在 pnpm 命令开头不使用“sudo”命令,但我需要使用它来终止端口并重新启动

最佳答案

从脚本中删除 sudo 并让 pnpm 在没有它的情况下运行 - 它不需要 root 权限。

sudo 旨在由人类用户在终端中使用,默认情况下它需要用户密码才能以提升的权限运行命令。

在 Jenkins 上运行作业时,不应使用 sudo

关于shell - Jenkins 失败: a terminal is required to read the password; either use the -S option to read from standard input,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74812572/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com