2

I am trying to add a plugin to Cordova via

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

git itself seems to run fine. Running the following works:

git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390234462383"

This is what is used in plugins.js line 43 (var cmd = util.format(...)).

The error I receive using the cordova plugin add ... is:

Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"...
Fetching plugin via git-clone command: git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390235833828"

C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error: Fetching plugin failed: Error: Command failed: Cloning into 'D:\Temp\plugman-tmp1390234462383'...
fatal: unable to access 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git/': Failed connect to git-wip-us.apache.org:443; No error

at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:90:41
at _rejected (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)

Any idea?

Some more information:

I am going through a proxy, but I set this for git and for npm. I installed Cordova via "npm install cordova" and the project via "cordova create TestApp", I added platforms via "cordova platform add android" and I can run the app on the emulator.

I even tried "phonegap local plugin add https..." with the same result.

All that is missing for me is to add plugins.

11
  • 1
    Can you run the cordova plugin add command with -d flag to get more output and see if the error message has improved? Can you try doing cordova plugin add org.apache.cordova.device-motion and see if it's different (Using the plugin name instead of the actual git url). Also, try just deleting the \cordova` folder inside your node_modules` folder. This will clear the 'cordova cache' which can sometimes get messed up when there is an upgrade and/or problem with npm (last week the servers were a little goofy.) Finally, why is your temp drive in D:// but your commands in C://?
    – MBillau
    Jan 20, 2014 at 16:34
  • I added the additional lines to the output, which is basically the first three lines (Calling plugman.fetch....)
    – Dinkheller
    Jan 20, 2014 at 16:41
  • 1
    "cordova plugin add org.apache.cordova.device-motion" throws a ETIMEDOUT
    – Dinkheller
    Jan 20, 2014 at 16:42
  • I have set all TEMP path variables to D:\Temp and the user dir is still inside C:/Users/...
    – Dinkheller
    Jan 20, 2014 at 16:44
  • 2
    I had the same problem. Please see here for the solution that worked for me.
    – M.A.Naseer
    Aug 15, 2014 at 14:06

4 Answers 4

5

Sometimes a Cordova update will cause problems with npm and will corrupt the "cordova cache" that NPM uses to quickly download different Cordova versions. I know there were problems with the server pushing the latest Cordova plugins to NPM, so maybe this is why you're having trouble.

I'd suggest deleting /AppData/Roaming/npm/node_modules/cordova direct in its entirety, than installing a fresh new copy with npm install -g cordova. This shouldn't remove any of your Cordova projects, it will just download a fresh set of the tools. When you run cordova commands, it might take longer the first time since the tools will have to go to the git repo's and fetch the content fresh.

2
  • 1
    Did not help me. But as you got two upvotes so far, seems to help other :)
    – Dinkheller
    Oct 27, 2014 at 9:28
  • It also helped me. It worked, despite I don't understant exactly what happened :) Nov 13, 2015 at 21:22
1

Tried clearing the cordova cache by deleting the folder as suggested by @mbillau but that didn't help. I search for the plugin where I was getting the error and tried installing through command line but got the same error message. Finally the solution that worked for me:

  1. open important files in your IDE
  2. open Cordova plugins
  3. replace all "https://git-wip-us.apache.org/repos/asf/" with "https://git.apache.org/"

and it worked perfectly.

1
1

Replace "git-wip-us.apache.org/repos/asf7" with "github.com/apache/" Like @Max said.

0

Checking the apache site (either https://git-wip-us.apache.org/repos/asf/, https://gitbox.org/repos/asf/, or https://git.apache.org/) I only see commit logs instead of the sources.

The sources can be found on GitHub. This worked for me: cordova plugin add https://github.com/apache/cordova-plugin-device.git

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.