I have following code in my script.
echo Trying to kill all node processes.
taskkill /f /im node.exe
echo Running the application...
start npm run prod
echo Success...
The script runs fine if I open a command prompt and run it from there but it doesn't start the npm run
process when I run it from Jenkins pipeline.
Strange thing is the build gets success.
Can anyone help me solve this riddle? Thanks. Update - 1 This is the output in Jenkins.
up to date in 23.58s
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deployment)
[Pipeline] bat
[ABC Pipeline] Running batch script
*************************************
Build Started
@author:
*************************************
Trying to kill all node processes.
ERROR: The process "node.exe" not found.
Running the application...
Success...
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Automation Testing)
[Pipeline] echo
Testing...
[Pipeline] echo
Tests passed!
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Update - 2 The npm file extension is .cmd and Windows 10 with Jenkins 2.89.4