首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >exec:"pwsh":在%PATH%中未找到可执行文件

exec:"pwsh":在%PATH%中未找到可执行文件
EN

Stack Overflow用户
提问于 2021-06-24 11:28:35
回答 2查看 3.9K关注 0票数 12

我一直试图在gitlab CI/CD上为一个演示项目启动我的渠道。我已经在我的windows本地机器上安装了gitlab-runner,并给出了"Shell“的执行类型。我已经成功地将gitlab-runner与我的gitlab项目集成在一起。但每当我将任何更改推送到repo时,管道都会启动,并以"pshw“not found in %PATH error结束。This is error which I'm getting every time

代码语言:javascript
运行
复制
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

有没有人可以帮我解决这个问题,并解释我得到这个错误的原因。

提前感谢

EN

回答 2

Stack Overflow用户

发布于 2021-06-25 18:21:49

在选择外壳选项时,gitlab runner安装程序使用pwsh作为执行器。它会生成一个config.toml,如下所示

代码语言:javascript
运行
复制
[[runners]]
  name = "some name"
  url = "http://someurl.com/"
  token = "some-token"
  executor = "shell"
  shell = "pwsh"

问题是pwsh不是一个有效的windows命令(在我的安装中)。将pwsh更改为powershell并重启gitlab-runner服务为我修复了这个问题。

票数 13
EN

Stack Overflow用户

发布于 2021-07-23 09:34:19

转到GitLab运行程序的安装目录,例如C:\Automation\GitLab-Runner。在这里你会看到config.toml文件,用记事本打开,并用powershell替换pwsh,如下所示:

发自:

代码语言:javascript
运行
复制
[[runners]]
  name = "PT-Runner"
  url = "https://gitlab.com"
  executor = "shell"
  shell = **"pwsh"**

至:

代码语言:javascript
运行
复制
[[runners]]
  name = "PT-Runner"
  url = "https://gitlab.com"
  executor = "shell"
  shell = **"powershell"**
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68109273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档