Issue
I installed Jenkins and started and configured my sample Cordova project with it. I created a multi – configuration project, where my Configure page contains following details.
- Multi-configuration project name : Phonegap
- Github Project URL :
- Source Code Management :
Git Repositories :
Repository URL : - Build Triggers
Poll SCM where Schedule time is :H/5 **** - Configuration Matrix
Name : Platforms
Values: windows android - Build
Command :
cd ProjectName
cordova platform add $PLATFORM
cordova build
and I appiled Save
Now, when I create a build it failed with two platforms
Configurations
Windows and Android
when to clicked on each platform Failed build says:
C:\Program Files (x86)\Jenkins\workspace\Phonegap\PLATFORM\windows>cd HelloWorldCordova
C:\Program Files (x86)\Jenkins\workspace\Phonegap\PLATFORM\windows\XXXCordova>cordova platform add $PLATFORM
'cordova' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files
(x86)\Jenkins\workspace\Phonegap\PLATFORM\windows\HelloWorldCordova>cordova build
'cordova' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files
(x86)\Jenkins\workspace\Phonegap\PLATFORM\windows\XXXCordova>exit 9009
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
so what did I miss and what is the problem here?
Default Jenkins installed in C:
.
Can anyone help me how to proceed with such problem? And what are things needs to configure yet?
Solution
It seems that npm
is not added to your system’s environment variables/PATH as you are getting the error message 'cordova' is not recognized as an internal or external command
. NPM manages the ‘cordova’ command linking as far as I remember
In Windows
Start -> Control Panel -> System and Security -> System -> Environment variables
ADD the following to the end of your PATH
;C:\Users\user1\AppData\Roaming\npm
Replace user1
with the username on which the command is being executed
Semi-colon is important as it splits this entry from the last existing entry in your path, and adding to the end it is important as you don’t want to break any existing tools and such that are configured in your path.
Answered By – Peter Reid
Answer Checked By – Katrina (AngularFixing Volunteer)