TeamCity build runner无法识别可执行文件 [英] TeamCity build runner not recognizing executable

查看:308
本文介绍了TeamCity build runner无法识别可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在TeamCity中运行一个简单的 gruntfile.js 作为我的构建的一部分。但是,即使在将grunt和grunt-cli安装为全局节点包之后,TeamCity仍然无法识别它们。我可以在命令行中输入 grunt ,但是当我在TeamCity中通过命令行运行器或带参数的可执行文件运行它时,仍然会提供



'grunt'不被识别为内部或外部命令



我也尝试安装 TeamCity.Node ,这是一个用于运行grunt脚本的插件,但它找不到grunt或者。任何想法?

解决方案

我无法得到接受的解决方案。我的问题是TeamCity服务(服务器和代理)在系统帐户下运行。 AFAIK,没有为所有OS用户全局安装npm包的概念。所以我:


  1. 创建了TeamCity Windows用户

  2. 更改了TeamCity服务,

  3. 以TeamCity用户身份登录操作系统

  4. 运行npm install -g grunt-cli



  5. 从这里,NodeJS,NPM和Grunt任务刚刚开始工作。


    I'm trying to run a simple gruntfile.js as part of my build in TeamCity. However, even after installing grunt and grunt-cli as global node packages, TeamCity still won't recognize them. I can type grunt in the command line and it works, but when I run it in TeamCity either through a command line runner or an executable with parameters, it still gives

    'grunt' is not recognized as an internal or external command

    I also tried installing TeamCity.Node, which is a plugin for running grunt scripts, but it can't find grunt either. Any ideas?

    解决方案

    I couldn't get the accepted solution to work. The problem for me was that TeamCity services (server and agent) were running under system accounts. AFAIK, there is no concept of "globally install npm package for all users of the OS". So I:

    1. created a TeamCity windows user
    2. changed the TeamCity services to run as that user
    3. logged into the OS as the TeamCity user
    4. ran npm install -g grunt-cli
    5. restarted the services.

    From there, the NodeJS, NPM and Grunt tasks just started working.

    这篇关于TeamCity build runner无法识别可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆