-
Notifications
You must be signed in to change notification settings - Fork 342
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
'--searchpath' not working properly on Cordova 10.0 #539
Comments
In my testing it appears |
@ath0mas Yes indeed. I am using scope on my package names. Is scoping deprecated? Are you meaning that scoping has a higher priority than searchpath parameter? |
@breautek Thank you for you reply. I am using scoping for my plugins. |
Hey guys, I found scoping can cause many issues. I defined the dependency of my plugin with id= "@foo/ my-plugin-bar. When adding the plugin, the dependency plugin can be fetched correctly, while cordova CLI will raise error: Expected plugin to have ID "@foo/my-plugin-bar" but got "my-plugin-bar" I found that the target plugin was fetched to the foo folder under plugin folder while the dependency plugin is under the plugin folder NOT the foo folder. I believe this is causing the failure on looking up for the dependency. Is it a bug? |
I have the same issue. Is there a solution for this? |
@breautek I have ever tried to add scope to plugin and the searchpath paramter works as expected in this way. However altering id will cause javascript source locating under /plugins//... I don't want to modify the source code to workaround this issue. Is there any plan to fix this regression? Actually it works quite good on cordova 9 |
I haven't had a chance to look into a solution, or even the cause but a workaround could be either |
Once their is registry in dependency of this plugin, this would not work |
Same issue here. Any update on this topic? |
It seems like Cordova version 10.0.0 still has an issue related to adding a plugin with --searchpath. You can change the version of your Cordova CLI to 9.0.0 and it should work fine. |
This problem also exists in CLI version 11.1.0 of Cordova. When the plug-in that the added plug-in depends on is in the same directory, it does not search the specified --searchpath directory, but searches the dependent plug-in through the network. |
Problem
I am trying to adapting our product with Cordova CLI 10. After upgrading to CLI 10.0, when adding plugin in cordova project using '--searchpath' parameter, query on registry will be hit before on local search path
What is expected to happen?
'--searchpath' should help the command query the folder I set before querying on the registry
What does actually happen?
'--searchpath' is hitting registry before local folder. This is not consistent with the definition of this parameter
Information
Here is the command history
I hid the registry name, plugin name and version for business reason
cordova plugin add <my plugin>@<my version> --searchpath /Users/*****/Documents/SDK/plugins
Installing "<my plugin>" for android
Failed to install '<my plugin>': CordovaError: Failed to fetch plugin @<my registry>/<my dependency>@<my version> 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 E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@%2f - Not found
npm ERR! 404
npm ERR! 404 '@<my registry>/<my dependency>@<my version> ' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Environment, Platform, Device
MacOS 10.15.7
npm v6.14.7
node v14.4.0
Version information
Cordova CLI 10.0.0
Checklist
The text was updated successfully, but these errors were encountered: