我刚刚安装了jenkins(安装了建议的插件),后面添加了插件> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/reponame/Api-call-testing-automation.git # timeout=10
Fetching upstream changes from https://github.com/reponame/Api-call-testing-automation.git
> git --version # timeout=10
> git fetch --tags --progress https://github.com/reponame/Api-call-testing-automation.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 96d5533737397fdb51e1dd116ec5c0667ebb3752 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 96d5533737397fdb51e1dd116ec5c0667ebb3752
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master 96d5533737397fdb51e1dd116ec5c0667ebb3752
Commit message: "First Commit"
> git rev-list --no-walk 96d5533737397fdb51e1dd116ec5c0667ebb3752 # timeout=10
,但下面仍然出现相同的错误。有没有人有想法..?非常有帮助,谢谢! (我对jenkins btw很新)
舞台日志(邮差测试)
Git - https://www.youtube.com/watch?v=AVQQF_J3Az0&list=PLzQWIQOqeUSOu74jGJMRH06gneM3wL82Z - (自拍时间1s)
>[jsonplaceholder_api_test] Running shell script
+ npm install
/var/jenkins_home/workspace/jsonplaceholder_api_test@tmp/durable-25502f6e/script.sh: 2: /var/jenkins_home/workspace/jsonplaceholder_api_test@tmp/durable-25502f6e/script.sh: npm: not found
Shell脚本 - npm install - (自我时间271ms)
{{1}}
答案 0 :(得分:0)
当然,您需要在执行测试的构建代理上安装npm
!
我并不完全相信你真的在使用jenkins-pipeline,但在Docker容器中运行它会非常容易(使用安装了npm
的图像。)
否则准备实例(可能只运行单个Jenkins主实例)并安装NPM并将其提供给Jenkins用户。
答案 1 :(得分:0)
你需要从Jenkins配置NodeJ - >管理Jenkins - >全局工具配置 - >的NodeJS。应复制到:Unresolvable nodeJS installer when run grunt in Jenkins
答案 2 :(得分:0)
我遇到了类似的问题,我将我的jenkins升级到最新版本,然后我就可以了。它似乎是Jenkins的一个错误,并且它已在最新版本中修复。