24

I did a cordova/phonegap upgrade and now I cannot install plugins from git urls anymore. Anyone experienced such an issue and already solved this?

$ cordova plugin add https://github.com/dawsonloudon/VideoPlayer.git
Fetching plugin "https://github.com/dawsonloudon/VideoPlayer.git" via git clone
Repository "https://github.com/dawsonloudon/VideoPlayer.git" checked out to git ref "master".
shell.js: internal error
Error: EXDEV, cross-device link not permitted '/var/folders/xl/bkl76rm570gfsmjspfjgh45h0000gn/T/git/1434106220728/LICENSE'
    at Object.fs.renameSync (fs.js:554:18)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/mv.js:77:8
    at Array.forEach (native)
    at Object._mv (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/mv.js:53:11)
    at Object.mv (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/common.js:186:23)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/plugins.js:53:19
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44

Version info:

$ phonegap -v
5.0.0-0.28.1

$ cordova -v
5.1.1

OSX 10.10.3

EDIT: It seems that it works if I move my repository to my home directory (~/).

7
  • what about git and node? Commented Jun 12, 2015 at 10:54
  • looks like not able to pull VideoPlayer plugin Commented Jun 12, 2015 at 10:59
  • Have you tried with other random cordova plugins, just to see if it's the plugin or your cordova setup Commented Jun 12, 2015 at 11:02
  • 1
    For me the problem is that my project is in /home in a different partition from /tmp that is where cordova is cloning the repository. I don't know why that's a problem for shell.js Commented Jun 16, 2015 at 8:04
  • @ancechu, same for me
    – Frank
    Commented Jun 26, 2015 at 6:42

10 Answers 10

26

I had the same issue with Cordova on Windows 7. I had to roll back to 5.0.0 (npm install -g [email protected]) to make it work again.

1
26

A quick fix is to clone the git locally and provide the path from there. For a plug-in to start working, all it needs is to see the plugin.xml file

So cordova plugin add https://github.com/phonegap/phonegap-plugin-fast-canvas.git -- fails because

shell.js: internal error Error: EXDEV, cross-device link not permitted '/ -- normal error in Cordova 5.1.0+. Applies to most if not all .git install

Local clone :: git clone https://github.com/phonegap/phonegap-plugin-fast-canvas.git

And local install cordova plugin add /path/to/phonegap-plugin-fast-canvas

Works.

1
  • Check your syntax, git clone cordova plugin add https://github.com/phonegap/phonegap-plugin-fast-canvas.git is incorrect. Commented Jun 25, 2015 at 9:27
5

This issue is fixed in the latest cordova version(5.2.0).

Upgrade Cordova using npm install -g cordova

4

To extend other great answers provided here,

As a temporary workaround, here's a one-liner that will downgrade Cordova, install plugin, and upgrade Cordova back:

npm install -g [email protected] && cordova plugin add [plugin url] && npm install -g cordova

Will take some time to execute, but eliminates all the manual repo cloning work.

1
2

I had the same situation with you. and resvole this problem need to pull back the cordova to 5.0.0

0
2

The problem comes from node.js fs.rename() which is unable to rename files cross devices.

A possible workaround is to replace fs.renameSync() with something else in cordova/node_modules/cordova-lib/node_modules/shelljs/src/mv.js

Eg:

var run=require('sync-runner');
...
run("mv '"+src+"' '"+thisDest+"'");
1

sudo npm install -g [email protected]

sudo cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git

1

Cordova 5.1.1 has a bug that can cause plugins installed from a Git repo to fail with the error "Error: EXDEV, cross-device link not permitted" if the project is on a different drive than your temp folder.

You can add plugins from npm. Or, if you must add a Git version of the plugin, you can instead download a copy, unzip it, and add the plugin from the file system by putting it in the config.xml and specifying the directory path in "spec": https://cordova.apache.org/docs/en/latest/config_ref/index.html#plugin

1

I had the same issue and got it resolved by following the advice of AMilassin (rolling back to Cordova Version 5.0) . Another issue I had was my Git installation path (C:\Program Files\Git\bin) was not added to the Environment Variables. Once I fixed both issues, I was able to install the plugins I needed.

1

For anyone having same issue with cordova version 7.0.1 or later, solve mine by including a package.json file in my project base directory and ensuring the version in the package.json file is of the pattern X.X.X example 1.0.0 else you would get invalid version error.

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.