Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade cordova: cannot install plugins from git urls anymore

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 (~/).

like image 414
mwager Avatar asked Jun 12 '15 10:06

mwager


4 Answers

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.

like image 174
AMilassin Avatar answered Jan 09 '23 13:01

AMilassin


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.

like image 40
Pian0_M4n Avatar answered Jan 09 '23 13:01

Pian0_M4n


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

Upgrade Cordova using npm install -g cordova

like image 30
Japheth Adhavan Avatar answered Jan 09 '23 11:01

Japheth Adhavan


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.

like image 39
Ivan Bartsov Avatar answered Jan 09 '23 11:01

Ivan Bartsov