Skip to content
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

cordova plugin add is broken for tarballs #452

Open
3 tasks done
janpio opened this issue Jul 17, 2019 · 3 comments
Open
3 tasks done

cordova plugin add is broken for tarballs #452

janpio opened this issue Jul 17, 2019 · 3 comments

Comments

@janpio
Copy link
Member

janpio commented Jul 17, 2019

Bug Report

Problem

I can't install a plugin from a .tgz file created via npm pack in a plugin folder.

What is expected to happen?

The plugin should be installed.

What does actually happen?

λ cordova plugin add "..\..\Cordova\cordova-plugin-device\cordova-plugin-device-2.0.4-dev.tgz"
Invalid Plugin! ..\..\Cordova\cordova-plugin-device\cordova-plugin-device-2.0.4-dev.tgz needs a valid package.json
λ cordova plugin add ./cordova-plugin-device-2.0.4-dev.tgz --verbose
No scripts found for hook "before_plugin_add".
No version specified for ./cordova-plugin-device-2.0.4-dev.tgz, retrieving version from config.xml
No version for null saved in config.xml or package.json
Attempting to use npm info for null to choose a compatible release
Running command: npm view ./cordova-plugin-device-2.0.4-dev.tgz --json
Command finished with error code 0: npm view,./cordova-plugin-device-2.0.4-dev.tgz,--json
npm info for helloworld did not contain any engine info. Fetching latest release
Calling plugman.fetch on plugin "./cordova-plugin-device-2.0.4-dev.tgz"
Invalid Plugin! cordova-plugin-device-2.0.4-dev.tgz needs a valid package.json
CordovaError: Invalid Plugin! cordova-plugin-device-2.0.4-dev.tgz needs a valid package.json
    at C:\Users\Jan\scoop\persist\nvm\nodejs\v12.6.0\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:78:43
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

Same happens on Mac as well.

Information

Version information

λ cordova -v
9.0.0 ([email protected])

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@janpio
Copy link
Member Author

janpio commented Jul 17, 2019

Code: https://github.com/apache/cordova-lib/blob/master/src/plugman/fetch.js#L71

Documented example of usage of plugin add with .tgz file: https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-plugin-command + scroll down to Examples - or - Ctrl + F for cordova plugin add ../cordova-plugin-camera.tgz

@distante
Copy link

distante commented Oct 9, 2019

So it is a known issue then

@TheHighriser
Copy link

I have the same problem. Installation of tgz is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants