MaginSoft / MFileChooser

Cordova/Phonegap plugin that supplies a File Chooser
MIT License
16 stars 48 forks source link

Error while installing #18

Closed leoli-dev closed 5 years ago

leoli-dev commented 7 years ago

Hello there, I got this error while trying to install the package:

> cordova plugin add https://github.com/MaginSoft/MFileChooser.git --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/MaginSoft/MFileChooser.git --save (exit code 1):

        Error: Failed to fetch plugin https://github.com/MaginSoft/MFileChooser.git 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 235 Error output:
        npm ERR! addLocal Could not install /tmp/npm-5634-a7d9437c/git-cache-a9427c86/6a23ad5842440071406aef0080f07b36ded7528c
        npm ERR! Darwin 16.6.0
        npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "install" "https://github.com/MaginSoft/MFileChooser.git" "--save"
        npm ERR! node v7.9.0
        npm ERR! npm  v4.2.0
        npm ERR! code EISDIR
        npm ERR! errno -21
        npm ERR! syscall read

        npm ERR! eisdir EISDIR: illegal operation on a directory, read
        npm ERR! eisdir This is most likely not a problem with npm itself
        npm ERR! eisdir and is related to npm not being able to find a package.json in
        npm ERR! eisdir a package you are trying to install.
bendspoons commented 5 years ago

Hi, the package.json is simply missing. Its NEEDED from Cordova >= 8 (before 8 you could add --nofetch Option, which was removed in Cordova 8). See my fork or clone this Original Repo and yimply add the package.json

https://github.com/bendspoons/MFileChooser/blob/master/package.json

PS. If you use the Original Repo, watch out to replace the git url back to https://github.com/MaginSoft/MFileChooser.git in the package.json

leoli-dev commented 5 years ago

Oh, I posted this such a long long time ago that I forgot if I've already solved it or not. Anyway, thank you for your answer @bendspoons