xavierserrai opened a new issue, #1443:
URL: https://github.com/apache/cordova-ios/issues/1443

   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   
   Plugin is expected to be uninstalled properly.
   
   ### What does actually happen?
   
   Plugin is not installed, it crashes giving the following error:
   
   ## Information
   
   Full error trace:
   
   ````
   Executing script found in plugin <PLUGIN_NAME> for hook "before_plugin_rm": 
plugins/<PLUGIN_NAME>/hooks/ios/before_plugin_rm.js
   Calling plugman.uninstall on plugin "<PLUGIN_NAME>" for platform "ios"
   The plugin '<PLUGIN_NAME>' is required by (<PLUGIN_NAME>) but forcing removal
   Finding scripts for "before_plugin_uninstall" hook from plugin <PLUGIN_NAME> 
on ios platform only.
   No scripts found for hook "before_plugin_uninstall".
   Uninstalling <PLUGIN_NAME> from ios
   Loaded API for ios project 
<PROJECT_PATH>/cordova-ios/platforms/ios/cordova/Api.js
   Beginning processing of action stack for ios project...
   Error during processing of action! Attempting to revert...
   Adding non-custom framework to project... WebKit.framework -> 
{"customFramework":false,"embed":false,"link":true,"weak":true}
   Non-custom framework added to project. WebKit.framework -> 
{"customFramework":false,"link":true,"weak":true}
   Uh oh!
   Path is a directory: rm returned EISDIR (is a directory) 
<PROJECT_PATH>/cordova-ios/platforms/ios/www/plugins/<PLUGIN_NAME>
   SystemError [ERR_FS_EISDIR]: Uh oh!
   Path is a directory: rm returned EISDIR (is a directory) 
<PROJECT_PATH>/cordova-ios/platforms/ios/www/plugins/<PLUGIN_NAME>
       at Object.rmSync (node:fs:1268:13)
       at removeFileF 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-ios/lib/plugman/pluginHandlers.js:368:8)
       at uninstall 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-ios/lib/plugman/pluginHandlers.js:188:13)
       at ActionStack.process 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-common/src/ActionStack.js:55:25)
       at PluginManager.doOperation 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-common/src/PluginManager.js:111:24)
       at PluginManager.removePlugin 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-common/src/PluginManager.js:145:21)
       at Api.removePlugin 
(<PROJECT_PATH>/cordova-ios/node_modules/cordova-ios/lib/Api.js:303:14)
       at handleUninstall 
(<NODE_MODULES_PATH>/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:318:10)
       at 
<NODE_MODULES_PATH>/cordova/node_modules/cordova-lib/src/plugman/uninstall.js:306:16
   
   ````
   
   ### Command or Code
   
   Error given when executing
   
   ````
   cordova plugin rm <plugin-name>
   ````
   
   ### Environment, Platform, Device
   
   ### Version information
   
   12.0.0 (cordova-lib@12.0.1)
   cordova platform: ios 7.1.0
   
   ## 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
   
   ## Bug found:
   
   In commit:
   
   
https://github.com/apache/cordova-ios/commit/f7e29536474378249ba6278ce88aa853fef1f923
   
   There was a replacement of 
   ````
   const fs = require('fs-extra'); 
   ````
   by 
   ````
   const fs = require('node:fs');
   ````
   
   In file:
   
   `````
   lib/plugman/pluginHandlers.js
   `````
   
   In ````removeFileF```` function there was a replacement of the function of 
```fs.removeSync(file);``` by ```fs.rmSync(file);```. Somehow, it seems that 
the old function deleted everything by default, including folders recursively 
but the new one doesn't do it. The solution I found was to add the parameters 
to make it recursive:
   
   ````
   
/Users/xavierserra/Documents/repo/mobile-monorepo-project/native/alyusr/ALYUSR_FINANCE/cordova-ios/platforms/ios/www/wk-plugin.js
   ````


-- 
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-unsubscr...@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to