【问题标题】:Jenkins powershell ng is not recognizedJenkins powershell ng 无法识别
【发布时间】:2018-01-31 06:51:54
【问题描述】:

当我运行 Jenkins 作业时

我收到以下错误:

the term 'ng' is not recognized as the name of a cmdlet

有人知道该怎么做吗?

【问题讨论】:

    标签: node.js jenkins deployment compiler-errors web-deployment


    【解决方案1】:

    您应该将ng 可执行文件的路径 添加到您的%PATH% 环境变量中。

    如果你全局安装了@angular/cli,应该是%AppData%\npm\bin

    或者如果你只在项目中安装了它,它应该是.\node_modules\.bin

    在 Powershell 中,只需使用

    $env:Path += ";$env:APPDATA\npm\bin"
    

    【讨论】:

    • 对不起,我在主机上执行是可以的,但是在jenkins里面就不行了。
    【解决方案2】:
    1. 在 jenkins 中安装 nodejs。
    2. jenkins 中的全局工具配置。

    1. 在作业页面上构建环境。

    1. powershell 进入 ng build,成功。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-17
      • 2014-07-08
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      • 2014-01-08
      • 2012-09-13
      • 2020-03-03
      相关资源
      最近更新 更多