-
Notifications
You must be signed in to change notification settings - Fork 27
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@8.0.0 -> cordova@9.0.0 breaks plugin installs using git repos or local directories #87
Comments
I poked around this a little bit, and the Code
So the real error is |
Code
Essentially, the code expects the npm install output to have a |
The npm install command is launched using And now I come to the part that I don't understand. If I use Command line arguments for npm install
If I run the exact same command using superspawn using the node REPL, I get an output with the running same command in node REPL
But if I add the same kind of output logging in e.g. if I change the code to New code
I get the following output non-REPL usage$ npx cordova plugin -d add https://github.com/phonegap/phonegap-plugin-contentsync.git
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "https://github.com/phonegap/phonegap-plugin-contentsync.git"
fetch: Installing https://github.com/phonegap/phonegap-plugin-contentsync.git to /Users/kshankar/e-mission/upgrade_platform
Running command: npm install https://github.com/phonegap/phonegap-plugin-contentsync.git --production --save
Command finished with error code 0: npm install,https://github.com/phonegap/phonegap-plugin-contentsync.git,--production,--save
Output = phonegap-plugin-contentsync@1.4.2 node_modules/phonegap-plugin-contentsync
Failed to fetch plugin https://github.com/phonegap/phonegap-plugin-contentsync.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
phonegap-plugin-contentsync@1.4.2 node_modules/phonegap-plugin-contentsync
CordovaError: Failed to fetch plugin https://github.com/phonegap/phonegap-plugin-contentsync.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Could not determine package name from output:
phonegap-plugin-contentsync@1.4.2 node_modules/phonegap-plugin-contentsync
at /Users/kshankar/e-mission/upgrade_platform/node_modules/cordova-lib/src/plugman/fetch.js:146:43
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I can't figure out why |
Finally, Logs``` $ npx cordova plugin -d add phonegap-plugin-contentsync No scripts found for hook "before_plugin_add". No version specified for phonegap-plugin-contentsync, retrieving version from package.json Calling plugman.fetch on plugin "phonegap-plugin-contentsync@^1.4.2" Copying plugin "/Users/kshankar/e-mission/upgrade_platform/node_modules/phonegap-plugin-contentsync" => "/Users/kshankar/e-mission/upgrade_platform/plugins/phonegap-plugin-contentsync" Calling plugman.install on plugin "/Users/kshankar/e-mission/upgrade_platform/plugins/phonegap-plugin-contentsync" for platform "android Installing "phonegap-plugin-contentsync" for android Running command: /Users/kshankar/e-mission/upgrade_platform/platforms/android/cordova/version Command finished with error code 0: /Users/kshankar/e-mission/upgrade_platform/platforms/android/cordova/version Finding scripts for "before_plugin_install" hook from plugin phonegap-plugin-contentsync on android platform only. No scripts found for hook "before_plugin_install". Install start for "phonegap-plugin-contentsync" on android. PlatformApi successfully found for platform android Beginning processing of action stack for android project... Action stack processing complete. Install complete for phonegap-plugin-contentsync on android. Finding scripts for "after_plugin_install" hook from plugin phonegap-plugin-contentsync on android platform only. No scripts found for hook "after_plugin_install". Calling plugman.install on plugin "/Users/kshankar/e-mission/upgrade_platform/plugins/phonegap-plugin-contentsync" for platform "ios Installing "phonegap-plugin-contentsync" for ios Running command: /Users/kshankar/e-mission/upgrade_platform/platforms/ios/cordova/version Command finished with error code 0: /Users/kshankar/e-mission/upgrade_platform/platforms/ios/cordova/version Finding scripts for "before_plugin_install" hook from plugin phonegap-plugin-contentsync on ios platform only. No scripts found for hook "before_plugin_install". Install start for "phonegap-plugin-contentsync" on ios. PlatformApi successfully found for platform ios Beginning processing of action stack for ios project... Adding non-custom framework to project... libz.dylib -> {"customFramework":false,"embed":false,"link":true,"weak":false} Non-custom framework added to project. libz.dylib -> {"customFramework":false,"link":true,"weak":false} Action stack processing complete. pods.json found in platforms/ios Podfile found in platforms/ios Install complete for phonegap-plugin-contentsync on ios. Finding scripts for "after_plugin_install" hook from plugin phonegap-plugin-contentsync on ios platform only. No scripts found for hook "after_plugin_install". Adding phonegap-plugin-contentsync to package.json No scripts found for hook "after_plugin_add". ``` |
Thanks for reporting this and for the detailed information and debugging. It's indeed strange that the npm output differs between manual invocations and those performed by cordova-fetch. Just to be sure that this is still an issue in the current code base, could you please try if you can reproduce this issue when using cordova@nightly? |
Ok, so I poked around this some more, and I know the reason behind the difference in After adding log statements to all instances of superspawn, it looks like this is difference is due to the differences in the versions of superspawn included in the project.
While using node directly, we use |
so the two versions are different because the versions of
|
But if I use the Logs
I will try with the latest cordova@nightly and if that still doesn't work, I'm going to try to create a MCVE to make it easier for others to debug as well. |
@raphinesse Confirmed that this occurs even with Logs
|
Aha! While creating the MCVE, figured out the issue. I have both cordova and phonegap as dependencies. I was working on upgrading cordova first, and had not yet started upgrading phonegap, which was still at |
Similar to 9c705ab but for the other package.json Note that this includes phonegap and the resulting upgrade apache/cordova-fetch#87
Similar to 9c705ab but for the other package.json Note that this includes phonegap and the resulting upgrade apache/cordova-fetch#87
Bug Report
Problem
What is expected to happen?
should succeed since "url to a git repository containing a plugin.xml" is a valid plugin-spec.
What does actually happen?
Information
on cordova@8.0.0, plugins can be added using either the registry or a git URL
In the same directory, with cordova@9.0.0, plugins can only be added using the registry, and only intermittently
Note that, in the case of the registry add, the first run of the command fails, and the second run of the identical command succeeds
However, the git add always fails.
Command or Code
OR
Environment, Platform, Device
Mac OSX Catalina 10.15.5
Version information
For cordova and ionic:
For other cordova dependencies, I have attached my package.json
package.json.gz
For the rest of the environment:
Checklist
The text was updated successfully, but these errors were encountered: