【发布时间】:2023-03-23 10:53:01
【问题描述】:
我在 Tomcat7 - Windows 7 上运行 Jenkins。我在我的 jenkins 配置中提供了节点 bin 路径。然后运行一个shell脚本如下:
echo $PATH
node --version
npm install -g grunt-cli
npm install
grunt cssmin
正如其他帖子 Jenkins integration with Grunt 中所建议的那样,我已经多次重新启动我的 jenkins,并尝试处理该帖子中写的所有答案,但仍然显示错误,grunt: command not found。
来自 jenkins 控制台输出的错误堆栈跟踪:
/c/apache-maven-3.2.5/bin:/c/Program Files/Java/jdk1.7.0_79/bin:/c/Program Files/nodejs/bin:/c/Program Files/Java/jdk1.7.0_79/bin:/c/Program Files/nodejs/:
+ node --version
v0.10.30
+ npm install -g grunt-cli
C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\grunt -> C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt
grunt-cli@0.1.13 C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.7)
└── findup-sync@0.1.3 (lodash@2.4.2, glob@3.2.11)
+ npm install
npm WARN package.json Trademust@1.0.0 No repository field.
+ grunt cssmin
C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\hudson2968878175697925824.sh: line 6: grunt: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
我也按照本站grunt-on-jenkins中提到的步骤进行了
package.json 和 Gruntfile.js 第一次执行 jenkins 构建时位于根目录中,grunt 安装了我的 gruntfile.js 中的所有模块,之后在所有其他构建中显示上述输出。
任何人都可以检查这里发生了什么问题。
【问题讨论】: