从TeamCity运行时未找到jshint

从TeamCity运行时未找到jshint,teamcity,jshint,Teamcity,Jshint,我在我的计算机上安装了jshint,安装方式如下: npm install -g jshint 没有错误。从任何目录中的命令提示符键入: jshint -v 显示: jshint v2.6.0 我还安装了TeamCity 9.0.2,并使用以下命令行构建步骤进行了构建配置: jshint -v 但构建失败,构建日志显示: [17:43:06]Step 1/7: Command Line [17:43:06][Step 1/7] Starting: C:\TeamCity\buildAge

我在我的计算机上安装了jshint,安装方式如下:

npm install -g jshint
没有错误。从任何目录中的命令提示符键入:

jshint -v
显示:

jshint v2.6.0
我还安装了TeamCity 9.0.2,并使用以下命令行构建步骤进行了构建配置:

jshint -v
但构建失败,构建日志显示:

[17:43:06]Step 1/7: Command Line
[17:43:06][Step 1/7] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script1904467346557960405.cmd
[17:43:06][Step 1/7] in directory: C:\TeamCity\buildAgent\work\494a4c7f8e6d54de
[17:43:06][Step 1/7] 'jshint' is not recognized as an internal or external command,
[17:43:06][Step 1/7] operable program or batch file.
[17:43:06][Step 1/7] Process exited with code 1
[17:43:06][Step 1/7] Step Command Line failed
如何让jshint从TeamCity运行?

您必须在TeamCity中创建一个新的命令行生成步骤

rm -rf $(pwd)/node_modules/*  #removing subfolders present in node_modules folder
rm -rf $(pwd)/bower_components/*  #removing subfolders present in bower_components folder 
npm cache clean
npm install  #auto detect and install all npm modules required for your project
npm install bower
npm install grunt-ftp-push --save-dev #if ftp push is required
bower install
grunt buildproduction
仅此构建步骤就足够了。我希望这会起作用