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 2022/07/29 13:27:37 UTC

[GitHub] [cordova-lib] fquirin opened a new issue, #893: Cordova uses the wrong working directory and loads top-level config.xml

fquirin opened a new issue, #893:
URL: https://github.com/apache/cordova-lib/issues/893

   # Bug Report
   
   ## Problem
   
   My build script creates a sub-folder inside my actual project, copies the `www`, `package.json` and `config.xml` file over, enters the sub-folder and then tries to build everything from there, but instead of using the local `config.xml` the cordova command is reading the file from the top-level folder and uses the same folder as working directory to install plugins etc..
   
   ### What is expected to happen?
   
   Commands like `cordova plugin add ...` should read the files from the current working directory first and install node modules and plugins into the same folder.
   
   ### What does actually happen?
   
   Commands like `cordova plugin add ...` reference the first `config.xml` found in parent directory and use this as working directory to install node modules and plugins.
   
   ## Information
   
   Folder structure:
   ```
   myapp/
   |-- config.xml
   |-- package.json
   |-- www/
   |-- build_folder/
   | |-- config.xml
   | |-- package.json
   | |-- www/
   | |-- local_plugins/
   ```
   
   I've tried to use a globally and locally installed Cordova, same issue. Not entirely sure when this problem appeared but it was working for older Cordova builds (v8 or something).
   
   **To fix the issue** one has to **remove or rename** the config.xml from parent folder.
   
   ### Command or Code
   
   ```
   npm install -g cordova@11.0.0
   cd myapp/build_folder
   cordova plugin add ...
   ```
   After that check where the node modules and plugins are installed.
   
   ### Environment, Platform, Device
   - Linux 5.10.16.3-microsoft-standard-WSL2 x86_64 GNU/Linux
   - Debian 9.5
   
   ### Version information
   - Cordova: 11.0.0, Android platform 11.0.0
   - Other Frameworks: just Cordova
   - Operating System: Windows 11, Debian 9.5 WSL2
   
   ## Checklist
   - [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: issues-unsubscribe@cordova.apache.org.apache.org

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] fquirin commented on issue #893: Cordova uses the wrong working directory and loads top-level config.xml

Posted by GitBox <gi...@apache.org>.
fquirin commented on issue #893:
URL: https://github.com/apache/cordova-lib/issues/893#issuecomment-1199289140

   Ah sorry I just realized this should probably be moved to https://github.com/apache/cordova-cli ?


-- 
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: issues-unsubscribe@cordova.apache.org

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