2017-06-14 109 views
0

我在VSTS一個CI生成安裝失敗。其中一項任務是一個Grunt任務。當任務運行時,它失敗,出現以下的輸出:咕嚕任務在Visual Studio團隊服務(託管代理)

2017-06-14T18:00:44.8952691Z ##[section]Starting: grunt build

2017-06-14T18:00:44.8952691Z ==============================================================================

2017-06-14T18:00:44.8952691Z Task : Grunt

2017-06-14T18:00:44.8952691Z Description : The JavaScript Task Runner

2017-06-14T18:00:44.8952691Z Version : 0.5.27

2017-06-14T18:00:44.8952691Z Author : Microsoft Corporation

2017-06-14T18:00:44.8952691Z Help : More Information

2017-06-14T18:00:44.8952691Z ==============================================================================

2017-06-14T18:00:45.2362520Z [command]C:\NPM\Modules\grunt.cmd build --gruntfile d:\a\1\s\Solution\Project\Gruntfile.js

2017-06-14T18:00:47.3905419Z grunt-cli: The grunt command line interface (v1.2.0)

2017-06-14T18:00:47.3905419Z

2017-06-14T18:00:47.3905419Z Fatal error: Unable to find local grunt.

2017-06-14T18:00:47.4895387Z 2017-06-14T18:00:47.4895387Z If you're seeing this message, grunt hasn't been installed locally to

2017-06-14T18:00:47.4895387Z your project. For more information about installing and configuring grunt,

2017-06-14T18:00:47.4895387Z please see the Getting Started guide:

2017-06-14T18:00:47.4895387Z

2017-06-14T18:00:47.4895387Z http://gruntjs.com/getting-started

2017-06-14T18:00:47.6415301Z ##[error]Grunt failed with error: C:\NPM\Modules\grunt.cmd failed with return code: 99

2017-06-14T18:00:47.6475300Z ##[section]Finishing: grunt build

生成定義具有

Grunt Exists

的需求

我現在用的是「託管」代理隊列。當我查看「託管」代理功能時,它具有:

grunt C:\NPM\Modules\grunt.cmd

列出。

爲什麼生成代理失敗的說,它無法找到咕嚕?

回答

1

也就是說咕嚕-CLI,可以是執行咕嚕命令,但你仍然需要咕嚕包安裝到工作文件夾(如項目文件夾)

簡單的例子:

  1. 添加npm任務(工作文件夾:$(build.sourcesdirectory); npm命令:install;參數:grunt
  2. 添加Grunt任務(工作文件夾:$(build.sourcesdirectory);咕嚕文件路徑:[gruntfile.js file relative path of $(build.sourcesdirectory)
+0

這工作。謝謝! – jkruer01