【问题标题】:Jenkins/npm: not found/config setup/pluginJenkins/npm:未找到/配置设置/插件
【发布时间】:2018-07-12 11:13:57
【问题描述】:

我刚刚安装了 jenkins(安装了建议的插件),然后添加了插件 NodeJS Plugin,但下面仍然出现同样的错误。有没有人有想法..?对任何 cmets 都非常有帮助,谢谢! (顺便说一句,我对詹金斯很陌生)

阶段日志(邮递员测试)

Git -- https://github.com/reponame/Api-call-testing-automation.git -- (self time 1s)

> 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

Shell 脚本 -- npm install -- (self time 271ms)

>[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

【问题讨论】:

    标签: node.js jenkins npm jenkins-plugins jenkins-pipeline


    【解决方案1】:

    当然,您需要在执行测试的构建代理上安装npm

    我并不完全确信您真的在使用 ,但是在 docker 容器中运行它会很容易(使用安装了 npm 的图像)。

    否则准备实例(可能您只使用单个 Jenkins 主实例运行)并安装 NPM 并使其可供 Jenkins 用户使用。

    【讨论】:

      【解决方案2】:

      你需要从 Jenkins 配置 NodeJs -> 管理 Jenkins -> 全局工具配置 -> NodeJS。应复制到:Unresolvable nodeJS installer when run grunt in Jenkins

      【讨论】:

        【解决方案3】:

        我遇到了类似的问题,我将我的 jenkins 升级到最新版本,这对我来说没问题。貌似是Jenkins的bug,最新版本修复了。

        JENKINS-27170

        【讨论】:

          猜你喜欢
          • 2015-02-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-08-21
          • 2014-12-15
          • 1970-01-01
          相关资源
          最近更新 更多