2015-02-24 73 views
1

運行我安裝jshint我的電腦上使用時,未發現:jshint從TeamCity的

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運行?

回答

0

您必須在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 

這個構建步驟就足夠了。我希望這會起作用。