ng build command is not working via jenkins build execute shell

大城市里の小女人 提交于 2021-02-10 18:38:18

问题


In jenkins build execute area I put these command:

cd /var/lib/jenkins/workspace/test/
ng serve

Here is the screenshot:

I am getting an error like this:

  • cd /var/lib/jenkins/workspace/test/
  • ng serve

Environment variable TERM not defined!

Build step 'Execute shell' marked build as failure Finished: FAILURE

node v6.10.0

@angular/cli: 1.0.6

Please help me to resolve this issue.


回答1:


Try this I did jenkins integration today.

npm run ng build

This is working fine.




回答2:


In my case my slave Jenkins was working as Docker container and there was no global @angular/cli installation but in node_modules.

That's why I wanted to call ng command from @angular/cli/bin/ng. To able this I needed to add path of ng into PATH environment variable:

And the result:

Otherwise I will have to install angular cli in docker globally.



来源:https://stackoverflow.com/questions/45753959/ng-build-command-is-not-working-via-jenkins-build-execute-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!