agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

Update for Cordova v7? #103

Closed simonp92 closed 6 years ago

simonp92 commented 6 years ago

image

I am getting this error when trying to add the plugin to my Cordova project by running the command: cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 --variable XAPK_PUBLIC_KEY="MY_KEY_HERE"

I am running Cordova v. 7.0.1 and while I know this version is for 6.5.0, I wonder if you can update this to work for v.7?

The error seems to stem from the plugin not having an npm package.json file as described here: http://ourcodeworld.com/articles/read/455/cordova-error-failed-to-fetch-plugin-npm-not-being-able-to-find-a-package-json-in-a-package-you-are-trying-to-install

I can't tell if more work is required for it to work with v7 though

agamemnus commented 6 years ago

What does npm-debug.log say?

On Jun 25, 2017 7:37 AM, "simonp92" notifications@github.com wrote:

[image: image] https://user-images.githubusercontent.com/17639617/27515729-d7ef5596-59aa-11e7-9dfe-48313ff5027a.png

I am getting this error when trying to add the plugin to my Cordova project by running the command: cordova plugin add https://github.com/agamemnus/ cordova-plugin-xapkreader.git#cordova-6.5.0 --variable XAPK_PUBLIC_KEY="MY_KEY_HERE"

I am running Cordova v. 7.0.1 and while I know this version is for 6.5.0, I wonder if you can update this to work for v.7?

The error seems to stem from the plugin not having an npm package.json file as described here: http://ourcodeworld.com/articles/read/455/cordova- error-failed-to-fetch-plugin-npm-not-being-able-to-find-a- package-json-in-a-package-you-are-trying-to-install

I can't tell if more work is required for it to work with v7 though

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/103, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWHsHuOr5vSCmrW2vuRr_AlmSodB-ks5sHkZxgaJpZM4OElW_ .

jabawack81 commented 6 years ago

I have the same problem and this is my npm-debug.log

My versions: Npm 4.1.2 Cordova 7.0.1 Node v7.6.0 Windows 10

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
1 verbose cli   '--save' ]
2 info using npm@4.1.2
3 info using node@v7.6.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0
8 silly fetchOtherPackageData https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0
9 silly cache add args [ 'https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
9 silly cache add   null ]
10 verbose cache add spec https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add   spec: 'git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add   type: 'hosted',
11 silly cache add   hosted:
11 silly cache add    { type: 'github',
11 silly cache add      ssh: 'git@github.com:agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add      sshUrl: 'git+ssh://git@github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add      httpsUrl: 'git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add      gitUrl: 'git://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0',
11 silly cache add      shortcut: 'github:agamemnus/cordova-plugin-xapkreader#cordova-6.5.0',
11 silly cache add      directUrl: 'https://raw.githubusercontent.com/agamemnus/cordova-plugin-xapkreader/cordova-6.5.0/package.json' } }
12 verbose addRemoteGit caching https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0
13 verbose addRemoteGit git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 is a repository hosted by github
14 silly tryClone cloning git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 via git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0
15 verbose tryClone git-https-github-com-agamemnus-cordova-plugin-xapkreader-git-cordova-6-5-0-2d68b1d4 not in flight; caching
16 verbose correctMkdir C:\Users\[USER]\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
17 info git [ 'config', '--get', 'remote.origin.url' ]
18 silly validateExistingRemote git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 remote.origin.url: https://github.com/agamemnus/cordova-plugin-xapkreader.git
19 verbose validateExistingRemote git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 is updating existing cached remote C:\Users\[USER]\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-agamemnus-cordova-plugin-xapkreader-git-cordova-6-5-0-2d68b1d4
20 info git [ 'fetch', '-a', 'origin' ]
21 verbose updateRemote git fetch -a origin (https://github.com/agamemnus/cordova-plugin-xapkreader.git)
22 verbose setPermissions git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 skipping chownr on Windows
23 verbose resolveHead git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 original treeish: cordova-6.5.0
24 info git [ 'rev-list', '-n1', 'cordova-6.5.0' ]
25 silly resolveHead git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 resolved treeish: e5432a50e29297438480136718dc93788f507928
26 verbose resolveHead git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 resolved Git URL: git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#e5432a50e29297438480136718dc93788f507928
27 silly resolveHead Git working directory: C:\Users\[USER]\AppData\Local\Temp\npm-17660-3162181b\git-cache-fa2407e0\e5432a50e29297438480136718dc93788f507928
28 info git [ 'clone',
28 info git   'C:\\Users\\[USER]\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-agamemnus-cordova-plugin-xapkreader-git-cordova-6-5-0-2d68b1d4',
28 info git   'C:\\Users\\[USER]\\AppData\\Local\\Temp\\npm-17660-3162181b\\git-cache-fa2407e0\\e5432a50e29297438480136718dc93788f507928' ]
29 verbose cloneResolved git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 clone Cloning into 'C:\Users\[USER]\AppData\Local\Temp\npm-17660-3162181b\git-cache-fa2407e0\e5432a50e29297438480136718dc93788f507928'...
29 verbose cloneResolved done.
30 info git [ 'checkout', 'e5432a50e29297438480136718dc93788f507928' ]
31 verbose checkoutTreeish git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 checkout Note: checking out 'e5432a50e29297438480136718dc93788f507928'.
31 verbose checkoutTreeish
31 verbose checkoutTreeish You are in 'detached HEAD' state. You can look around, make experimental
31 verbose checkoutTreeish changes and commit them, and you can discard any commits you make in this
31 verbose checkoutTreeish state without impacting any branches by performing another checkout.
31 verbose checkoutTreeish
31 verbose checkoutTreeish If you want to create a new branch to retain commits you create, you may
31 verbose checkoutTreeish do so (now or later) by using -b with the checkout command again. Example:
31 verbose checkoutTreeish
31 verbose checkoutTreeish   git checkout -b <new-branch-name>
31 verbose checkoutTreeish
31 verbose checkoutTreeish HEAD is now at e5432a5... Merge pull request #73 from agwells/progress-in-MB
32 info git [ 'submodule', '-q', 'update', '--init', '--recursive' ]
33 verbose updateSubmodules git+https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 submodule update
34 error addLocal Could not install C:\Users\[USER]\AppData\Local\Temp\npm-17660-3162181b\git-cache-fa2407e0\e5432a50e29297438480136718dc93788f507928
35 silly fetchPackageMetaData Error: EISDIR: illegal operation on a directory, read
35 silly fetchPackageMetaData  error for https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 { Error: EISDIR: illegal operation on a directory, read errno: -4068, code: 'EISDIR', syscall: 'read' }
36 silly rollbackFailedOptional Starting
37 silly rollbackFailedOptional Finishing
38 silly runTopLevelLifecycles Finishing
39 silly install printInstalled
40 verbose stack Error: EISDIR: illegal operation on a directory, read
41 verbose cwd C:\[PROJECT FOLDER]\mobile\node_modules
42 error Windows_NT 10.0.14393
43 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0" "--save"
44 error node v7.6.0
45 error npm  v4.1.2
46 error code EISDIR
47 error errno -4068
48 error syscall read
49 error eisdir EISDIR: illegal operation on a directory, read
50 error eisdir This is most likely not a problem with npm itself
50 error eisdir and is related to npm not being able to find a package.json in
50 error eisdir a package you are trying to install.
51 verbose exit [ -4068, true ]
agamemnus commented 6 years ago

:/

Idk guys.

agamemnus commented 6 years ago

This seems to be a Cordova 7+ issue. Downgrading to 6.5.0 will allow an installation.

camilacanhete commented 6 years ago

package.json.txt

Cordova 7+ requires a package.json file inside plugin, i think.

EISDIR: illegal operation on a directory, read This is most likely not a problem with npm itself and is related to npm not being able to find a package.json in a package you are trying to install (remove the .txt from this json file and insert on the main folder and you should be ok for Cordova 7+)

agamemnus commented 6 years ago

Edit: ok.

agamemnus commented 6 years ago
  "repository": {
    "type": "git",
    "url": "git+https://github.com/agamemnus/cordova-plugin-xapkreader.git"
  },

Should that URL include the version? Thoughts? @camilacanhete.

camilacanhete commented 6 years ago

@agamemnus I didn't have to, but i was using a local build of the plugin. Maybe it's better to include the version just to be safe.

agamemnus commented 6 years ago

Done.