2017-06-14 181 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

相关问题