You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/11/24 01:05:09 UTC
[GitHub] [cordova-lib] Chuckytuh opened a new issue #861: Failure to install plugin with url#git_ref:subdir spec
Chuckytuh opened a new issue #861:
URL: https://github.com/apache/cordova-lib/issues/861
# Bug Report
There's a behavioural mismatch between documentation ([cordova-cli doc](https://github.com/apache/cordova-cli/tree/master/doc#plugin-spec), (Website)[https://cordova.apache.org/docs/en/latest/reference/cordova-cli/index.html#plugin-spec]) and what really happens when `cordova plugin add` is used when attempting to install a plugin from a git repo by specifying `git_ref` and `subdir`.
## Problem
### What is expected to happen?
According to the documentation, one could do:
```
cordova plugin add https://github.com/Chuckytuh/cordova-swift-plugins-test\#0.0.1:cordova-outsystems-swiftplugin42
```
In order to install a plugin that is located in the provided github under the specified subdir.
### What does actually happen?
Not what is documented. See:
```
23:36:55 ❯ cordova plugin add https://github.com/Chuckytuh/cordova-swift-plugins-test\#0.0.1:cordova-outsystems-swiftplugin42 --verbose
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42"
fetch: Installing https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42 to /Users/calcifer/Development/OutSystems/outsystems-mobile-rd/tmp/test-plugin-swift/myapp
Running command: npm install https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42 --save-dev
Command finished with error code 1: npm install,https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42,--save-dev
Failed to fetch plugin https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
CordovaError: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 128
npm ERR! Command failed: git checkout 0.0.1:cordova-outsystems-swiftplugin42
npm ERR! fatal: Cannot switch branch to a non-commit '0.0.1:cordova-outsystems-swiftplugin42'
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/calcifer/.npm/_logs/2020-11-24T00_57_08_549Z-debug.log
CordovaError: Failed to fetch plugin https://github.com/Chuckytuh/cordova-swift-plugins-test#0.0.1:cordova-outsystems-swiftplugin42 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
CordovaError: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 128
npm ERR! Command failed: git checkout 0.0.1:cordova-outsystems-swiftplugin42
npm ERR! fatal: Cannot switch branch to a non-commit '0.0.1:cordova-outsystems-swiftplugin42'
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/calcifer/.npm/_logs/2020-11-24T00_57_08_549Z-debug.log
at /Users/calcifer/.nodenv/versions/12.19.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:140:43
at processTicksAndRejections (internal/process/task_queues.js:97:5)
```
## Information
After debugging the install process, it is clear that `cordova-lib` is capable of parsing the required information from the URL (url, git_ref and subdir), sadly, when the times comes to fetch the plugin, `cordova-fetch` is executed which delegates to `npm install`, ending up failling because npm parses everything from `#` onwards as being the git_ref.
### Command or Code
```
$ cordova create testapp
$ cd testapp
$ cordova platform add ios
$ cordova plugin add https://github.com/Chuckytuh/cordova-swift-plugins-test\#0.0.1:cordova-outsystems-swiftplugin42
```
### Environment, Platform, Device
Both Android and iOS
### Version information
- cordova-cli: 10.0.0
- cordova-ios: 6.1.1
- macOS 10.15.7
- zsh
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [X] I searched for existing GitHub issues
- [X] I updated all Cordova tooling to most recent version
- [X] I included all the necessary information above
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-lib] dpogue commented on issue #861: Failure to install plugin with url#git_ref:subdir spec
Posted by GitBox <gi...@apache.org>.
dpogue commented on issue #861:
URL: https://github.com/apache/cordova-lib/issues/861#issuecomment-732517477
The `:subdir` syntax is no longer supported since we rely on npm for managing the dependencies
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-lib] dpogue closed issue #861: Failure to install plugin with url#git_ref:subdir spec
Posted by GitBox <gi...@apache.org>.
dpogue closed issue #861:
URL: https://github.com/apache/cordova-lib/issues/861
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org