Jenkins powershell ng无法识别

时间:2018-01-31 06:51:54

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

当我运行Jenkins工作时

enter image description here

我收到以下错误:

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

enter image description here

有谁知道该怎么做?

2 个答案:

答案 0 :(得分:0)

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

如果您在全球范围内安装了@angular/cli,则应为%AppData%\npm\bin

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

在Powershell中,只需使用

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

答案 1 :(得分:0)

  1. 在jenkins中安装nodejs。
  2. jenkins中的全局工具配置。
  3. enter image description here

    1. 在工作页面上构建环境。
    2. enter image description here

      1. powershell进入构建,成功。