whilename opened a new issue, #609:
URL: https://github.com/apache/cordova-cli/issues/609

   # Bug Report
   
   ## Problem
   In Cordova 11.1, when using the '--searchpath' command to specify the local 
registry address when adding a plug-in, if the added plug-in and the dependency 
are in the same directory, it uses the network registry instead of the same 
directory to search, resulting in the failure to add the plug-in and dependency 
correctly.
   
   ### What is expected to happen?
   When you specify the plug-in registry using '--serchpath', if the plug-in to 
be added is in the same root directory as the dependent plug-in, the registry 
should be searched in the same root directory first.
   
   
   ### What does actually happen?
   When the plug-in to be added is in the same root directory as the dependent 
plug-in, it does not search the registry in the same root directory first. 
Instead, it accesses the network registry search directly. As a result, the 
specified dependent plug-in cannot be found and stops working.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   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/*****/Desktop/Workspace/SDK-4.7.16/plugins
   Installing "my-plugin" for ios
   Failed to install 'my-plugin': CordovaError: Failed to fetch plugin 
@my-registry/my-dependency@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/@my-registry%2fmy-dependency - Not found
   npm ERR! 404 
   npm ERR! 404  '@my-registry/my-dependency@version' is not in this registry.
   npm ERR! 404 
   npm ERR! 404 Note that you can also install from a
   npm ERR! 404 tarball, folder, http url, or git url.
   
   npm ERR! A complete log of this run can be found in:
   npm ERR!     /Users/`*****`/.npm/_logs/2023-03-02T09_50_45_030Z-debug-0.log
       at 
/Users/`*****`/.nvm/versions/node/v18.14.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:140:43
       at process.processTicksAndRejections 
(node:internal/process/task_queues:95:5)
   Failed to fetch plugin @my-registry/my-dependency@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/@my-registry%2fmy-dependency - Not found
   npm ERR! 404 
   npm ERR! 404  '@my-registry/my-dependency@version' is not in this registry.
   npm ERR! 404 
   npm ERR! 404 Note that you can also install from a
   npm ERR! 404 tarball, folder, http url, or git url.
   
   npm ERR! A complete log of this run can be found in:
   npm ERR!     /Users/`*****`/.npm/_logs/2023-03-02T09_50_45_030Z-debug-0.log
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   cordova create test-app com.myapp.basic TestApp
   cd test-app
   cordova plugin add my-plugin@my-version --searchpath 
/Users/`*****`/Desktop/Workspace/SDK-4.7.16/plugins
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   MacOS 13.2.1
   node v18.14.2
   npm v9.5.0
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   Cordova: Cordova CLI 11.1 [email protected] Self-developed plug-in
   MacOS Ventura 13.2.1  Graphics Intel   Xcode
   
   
   ## 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to