Phonegap Cordova installation Windows
Solution 1:
After hours of frustration... here's what i discovered.
- Ignore the installation documentation and all the command line, node.js stuff (seriously you will waste hours on this.
- Go to github and simply download the PhoneGap master .zip
- In that zip are project files for window phone, etc platform... just use those templates.
I don't know how such an easy process could have worse documentation. It as if it was written by lawyers.
Solution 2:
I faced the same problem and struggled for an hour to get pass through by reading the documents and the other issues reported in Stack Overflow but I didn't find any answer to it. So, here is the guide to successfully run the phonegap/cordova in Windows Machine.
Follow these steps
- Download and Install node.js from http://nodejs.org/
- Run the command
npm install -g phonegap
(in case of phonegap installation) or run the commandnpm install -g cordova
(in case of Cordova installation). -
As the installation gets completed you can notice this:
C:\Users\binaryuser\AppData\Roaming\npm\cordova -> C:\Users\binaryuser\AppData\Roaming\npm\node_modules\cordova\bin\cordova [email protected] C:\Users\binaryuser\AppData\Roaming\npm\node_modules\cordova ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Notice the above line you can see the path were the file is mentioned. Copy that path. In my case it is
C:\Users\binaryuser\AppData\Roaming\npm\cordova
so usecd C:\Users\binaryuser\AppData\Roaming\npm\
and typecordova
. There it is, it finally works.- Since the
-g
key value isn't working you have set the Environment Variables path:- Press Win + Pause|Break or right click on
Computer
and chooseProperties
. - Click
Advanced system settings
on the left. - Click
Environment Variables
under theAdvanced
tab. - Select the
PATH
variable and clickEdit
. - Copy the path mentioned above to the value field and press
OK
.
- Press Win + Pause|Break or right click on
Solution 3:
This answer was first posted here: cordova/phonegap does not make android directory
With the release of Cordova 3.3.0, it seems the PhoneGap team is trying to address the naming confusion. The documentations have been updated to recommend people using the cordova
command instead. Do not use the command anymore.phonegap
Here is a fresh installation guide for a guaranteed trouble free set up:
-
Install Cordova (forget the name PhoneGap from now on). For PC:
C:> npm install -g cordova
-
From command prompt, navigate to the folder you want to create your project using:
cordova create hello com.example.hello HelloWorld cd hello
-
Define the OS you want to suppport for example:
cordova platform add wp8
-
Install plugins (If needed). For example we want the following:
cordova plugin add org.apache.cordova.device cordova plugin add org.apache.cordova.camera cordova plugin add org.apache.cordova.media-capture cordova plugin add org.apache.cordova.media
- Finally, generate the app using:
cordova build wp8
Here is a link to the PhoneGapCordova 3.3.0 Documentation
http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface
Solution 4:
I faced this same error too. And i even tried downloading the PhoneGap master from GitHub,but i found out that what i got was Phonegap 2.9. I eventually had to download the Cordova 3 Source
Follow this steps to get it.
- Download and unzip the Cordova 3 Source
- Run the template.bat in the cordova-wp8 folder
- Copy the generated Zip files to your Visual studio template folder