问题
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