New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to fetch plugin using Cordova 7 #55

Closed
Shelf-A opened this Issue May 12, 2017 · 28 comments

Comments

Projects
None yet
@Shelf-A

Shelf-A commented May 12, 2017

This plugin have been working fine until ionic 3.2.0 and Cordova 7.

The cordova-plugin-imagePicker installs fine but when I open the image picker in emulator I get
"console.warn: Install the ImagePicker plugin: 'ionic plugin add
https://github.com/Telerik-Verified-Plugins/ImagePicker'"

console.log: plugin_not_installed

Then when I try to install it:
ionic cordova plugin add
? What plugin would you like to add: ht
tps://github.com/Telerik-Verified-Plugi
ns/ImagePicker

cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker --save
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker --sav... (exit code 1):

How should I install "https://github.com/Telerik-Verified-Plugins/ImagePicker"?

@dhavalsoni2001

This comment has been minimized.

dhavalsoni2001 commented May 15, 2017

I am also getting same error.

@Shelf-A

This comment has been minimized.

Shelf-A commented May 18, 2017

@dhavalsoni2001 a workaround is to @ionic/cli-plugin-cordova in your package.json and run npm install ionic plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker.

Although the Ionic Team made changes, I think they fixed the issue because on install plugin they added cordova so this should work now: ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker

@Julsonic

This comment has been minimized.

Julsonic commented May 18, 2017

It's not working for me too.
I have cordova v 7.0.0.

? What plugin would you like to add: https://github.com/Telerik-Verified-Plugins/ImagePicker

cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker --sav... (exit code 1):

    Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/ImagePicker via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Error: cmd: Command failed with exit code 1 Error output:
    npm ERR! git submodule -q update --init --recursive: fatal: 'submodule' appears to be a git command, but we were not
    npm ERR! git submodule -q update --init --recursive: able to execute it. Maybe git-submodule is broken?
    npm ERR! git submodule -q update --init --recursive:
    npm ERR! Windows_NT 10.0.14393
    npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/Telerik-Verified-Plugins/ImagePicker" "--save"
    npm ERR! node v6.10.2
    npm ERR! npm  v3.10.10
    npm ERR! code 128

Perhaps this does not work in cordova 7 because there is no package.json file in the plugin?

@dhavalsoni2001

This comment has been minimized.

dhavalsoni2001 commented May 18, 2017

@Shelf-A Yeah there is no package.json so I am getting that error. I have forked plugin and add package.json. Now its working fine.

https://github.com/dhavalsoni2001/ImagePicker.git

@g1bbzy

This comment has been minimized.

g1bbzy commented May 18, 2017

@dhavalsoni2001
So running Ionic cordova plugin install https://github.com/dhavalsoni2001/ImagePicker.git -> does not work.
but running cordova plugin install https://github.com/dhavalsoni2001/ImagePicker.git worked for me.
thanks

@dmastag

This comment has been minimized.

dmastag commented May 19, 2017

I saw a Pull Request that should solve this.
#53
Can this be merged?

@Shelf-A

This comment has been minimized.

Shelf-A commented May 19, 2017

@g1bbzy run cordova plugin install https://github.com/Telerik-Verified-Plugins/ImagePicker and see if it works.

@tordnilsen

This comment has been minimized.

tordnilsen commented May 19, 2017

I'm encountering the same problem with
"ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker"

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add https://github.com/Telerik-Verified-Plugins/ImagePicker --sav... (exit code 1):

        Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/ImagePicker via registry.
@dhavalsoni2001

This comment has been minimized.

dhavalsoni2001 commented May 19, 2017

@dmastag @tordnilsen This plugin is not updated since last 4-5 months. So I forked plugin and make it workable.

@dmastag

This comment has been minimized.

dmastag commented May 19, 2017

@dhavalsoni2001 I appreciate that and am using your fork right now until this one gets updated

@tordnilsen

This comment has been minimized.

tordnilsen commented May 19, 2017

@dhavalsoni2001 Thank you very much

@Jntz

This comment has been minimized.

Jntz commented May 24, 2017

@dhavalsoni2001 Thanks a lot!

@qiluo

This comment has been minimized.

qiluo commented May 25, 2017

@dhavalsoni2001 thanks for fork, same error, hopefully can merge as early as possible, thanks

@spencer1573

This comment has been minimized.

spencer1573 commented Jun 2, 2017

please merge. a lot of people still have this problem

@EddyVerbruggen

This comment has been minimized.

Member

EddyVerbruggen commented Jun 6, 2017

There's a package.json now..

@whitecat

This comment has been minimized.

whitecat commented Nov 1, 2017

I am facing this issue the only way I have found that works is forking the project and using the fork ionic cordova plugin add git+https://github.com/darkbasic/ImagePicker.git --save which is strange.

@Lenndev

This comment has been minimized.

Lenndev commented Dec 15, 2017

I am facing this problem with cordova 7.1.0
getting the following error:

Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/ImagePicker.git via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module

trying cordova plugin add https://github.com/Telerik-Verified-Plugins
doesnt work either, throws next error:
`Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! fetch failed https://github.com/Telerik-Verified-Plugins
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 406
npm ERR! fetch failed https://github.com/Telerik-Verified-Plugins
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 406
npm ERR! fetch failed https://github.com/Telerik-Verified-Plugins
npm ERR! Darwin 17.2.0
npm ERR! argv "/Users/lennaerd/.nvm/versions/node/v6.10.3/bin/node" "/Users/lennaerd/.nvm/versions/node/v6.10.3/bin/npm" "install" "https://github.com/Telerik-Verified-Plugins" "--production" "--save"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10

npm ERR! fetch failed with status code 406
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/lennaerd/Documents/HTML5Projects/atlhybrid/npm-debug.log
`

@shanke

This comment has been minimized.

shanke commented Dec 17, 2017

I get the following error message when trying to install:

Error: Failed to fetch plugin git+https://github.com/Telerik-Verified-Plugins/ImagePicker.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

[ERROR] An error occurred while running cordova plugin add cordova-plugin-telerik-imagepicker --variable
"PHOTO_LIBRARY_... (exit code 1).

@william-beange-hs

This comment has been minimized.

william-beange-hs commented Dec 18, 2017

Same issue as well.

cordova plugin add https://github.com/tapstream/phonegap3-plugin --save
Error: Failed to fetch plugin https://github.com/tapstream/phonegap3-plugin via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
TypeError: Parameter "url" must be a string, not undefined

node --version
v6.10.1
npm --version
3.10.10
cordova --version
7.1.0
@dhavalsoni2001

This comment has been minimized.

dhavalsoni2001 commented Jan 22, 2018

@Lenndev @shanke @william-beange-hs I am also getting same error. What's solution?

@chucker34

This comment has been minimized.

chucker34 commented Jan 23, 2018

@dhavalsoni2001
getting same error.
but your repository install succeeded!.
thanks!

@reicharm

This comment has been minimized.

reicharm commented Feb 18, 2018

I am also getting same error. Installing via @dhavalsoni2001's fork didn't work either ...

@macklus

This comment has been minimized.

macklus commented Mar 26, 2018

Same error here.

Fork from @dhavalsoni2001 works fine, and maybe it should be addopted by this.

@fromage9747

This comment has been minimized.

fromage9747 commented Apr 14, 2018

@macklus or @reicharm I have tried @dhavalsoni2001 fork and I am still getting the same error.

I have tried

ionic cordova plugin add https://github.com/dhavalsoni2001/ImagePicker.git
cordova plugin add https://github.com/dhavalsoni2001/ImagePicker.git

I have even tried:

ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"

from the ionic documentation which is Telerik Image picker and still the same issue.
https://ionicframework.com/docs/native/image-picker/

Error message:

UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch plugin https://github.com/dhavalsoni2001/ImagePicker.git via registry.

It is added to the fetch.json file under plugins as well as the others I have tried:

"com.synconset.imagepicker": {
    "source": {
      "type": "registry",
      "id": "https://github.com/arihantdaga/ImagePicker.git"
    },
    "is_top_level": true,
    "variables": {}
  },
  "cordova-plugin-image-picker": {
    "source": {
      "type": "registry",
      "id": "cordova-plugin-image-picker"
    },
    "is_top_level": true,
    "variables": {}
  },
  "telerik-imagepicker": {
    "source": {
      "type": "registry",
      "id": "https://github.com/dhavalsoni2001/ImagePicker.git"
    },
    "is_top_level": true,
    "variables": {}
  }
@Mr-Anonymous

This comment has been minimized.

Mr-Anonymous commented Apr 25, 2018

@fromage9747 Did you resolve the trouble. I get the same error too when trying to install this plugin:

(node:39362) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/ImagePicker.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:173:37
    at _rejected (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:864:24)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:890:30
    at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:808:41)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44
    at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:150:11)
(node:39362) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:39362) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My ionic info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    Cordova Platforms : android 6.3.0 ios 4.5.4
    Ionic Framework   : ionic1 1.3.3

System:

    ios-deploy : 1.9.2 
    ios-sim    : 5.0.13 
    Node       : v9.3.0
    npm        : 5.7.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

How can I resolve this? How can I install this plugin?

@nadavhury

This comment has been minimized.

nadavhury commented Sep 9, 2018

Does anyone know a solution for installing this plugin, I have installed it a year ago and removed it by mistake, can't install it now :-(

@fromage9747

This comment has been minimized.

fromage9747 commented Sep 9, 2018

@nadavhury @Mr-Anonymous I eventually gave up as I just couldn't get it to work. As I was following the Whatsapp clone project I eventually downloaded an up-to-date repo of it to use it. I have since no longer continued with it. Guess it would take some more googling to figure out an alternative. Sorry I couldn't have been more help.

@DenisAtFourth

This comment has been minimized.

DenisAtFourth commented Sep 21, 2018

@nadavhury i had it installed at some point in life. right now it failed me again on cordova 8. cheap solution: roll back to cordova 6.5 (npm i -g cordova@6.5.0), installed like a charm. reinstalled cordova 8, seems to work. rubbish, but worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment