Electron error installation
bilboeee opened this issue · comments
Hi,
I am trying to install the plugin for electron platform. but i have this error:
`
Installing "cordova-plugin-audioinput" for electron
Finding scripts for "before_plugin_install" hook from plugin cordova-plugin-audioinput on electron platform only.
No scripts found for hook "before_plugin_install".
Install start for "cordova-plugin-audioinput" on electron.
Beginning processing of action stack for browser project...
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-audioinput': Error: Uh oh!
EPERM: operation not permitted, unlink '__PATH__build/phonegap/platforms/electron/platform_www'
at Object.unlinkSync (fs.js:976:3)
at mayCopyFile (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:59:8)
at onFile (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:10)
at getStats (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
at startCopy (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
at handleFilterAndCopy (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
at Object.copySync (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
at Object.install (__PATH__build/phonegap/platforms/electron/cordova/handler.js:127:16)
at __PATH__build/phonegap/platforms/electron/cordova/Api.js:199:31
at ActionStack.process (__PATH__build/phonegap/node_modules/cordova-common/src/ActionStack.js:56:25)
Uh oh!
EPERM: operation not permitted, unlink '__PATH__build/phonegap/platforms/electron/platform_www'
Error: Uh oh!
EPERM: operation not permitted, unlink '__PATH__build/phonegap/platforms/electron/platform_www'
at Object.unlinkSync (fs.js:976:3)
at mayCopyFile (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:59:8)
at onFile (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:54:10)
at getStats (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
at startCopy (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
at handleFilterAndCopy (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
at Object.copySync (__PATH__build/phonegap/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
at Object.install (__PATH__build/phonegap/platforms/electron/cordova/handler.js:127:16)
at __PATH__build/phonegap/platforms/electron/cordova/Api.js:199:31
at ActionStack.process (__PATH__build/phonegap/node_modules/cordova-common/src/ActionStack.js:56:25)
`
I know the plugin is compatible with "browser" but not "electron".
But in the cordova documentation, "browser" plugin are compatible with "electron".
When adding a plugin, if the plugin supports both the electron and browser platform, the electron portion will be used. If the plugin misses electron but contains the browser implementation, it will fall back on the browser implementation.
Internally, Electron is using Chromium (Chrome) as its web view. Some plugins may have conditions written specifically for each different browser. In this case, it may affect the behavior of what is intended. Since Electron may support feature that the browser does not, these plugins would possibly need to be updated for the electron platform.
https://cordova.apache.org/docs/en/latest/guide/platforms/electron/
My package.json:
{ "name": "com.phonegap.helloworld", "version": "1.0.0", "displayName": "helloworld", "cordova": { "platforms": [ "android", "electron" ], "plugins": { "cordova-plugin-audioinput": {}, "cordova-plugin-file": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-network-information": {}, "cordova-plugin-device": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-file-opener2": { "ANDROID_SUPPORT_V4_VERSION": "27.+" } } }, "devDependencies": { "cordova-android": "^9.0.0", "cordova-electron": "^1.1.1", "cordova-osx": "^6.0.0", "cordova-plugin-audioinput": "git+https://github.com/edimuj/cordova-plugin-audioinput.git", "cordova-plugin-device": "^2.0.3", "cordova-plugin-file": "git+https://github.com/zorn-v/cordova-plugin-file.git#electron", "cordova-plugin-file-opener2": "^3.0.5", "cordova-plugin-inappbrowser": "^4.0.0", "cordova-plugin-network-information": "^2.0.2", "cordova-plugin-whitelist": "^1.3.4", "cordova-windows": "^7.0.1" } }
Can you help me please? :)
The plugin has no support for Electron. If somebody wants to implement it, just send me a PR.