cerebroapp / cerebro

🔵 Cerebro is an open-source launcher to improve your productivity and efficiency
https://www.cerebroapp.com/
MIT License
8.27k stars 454 forks source link

Can't uninstall failed plugin #655

Open linonetwo opened 1 year ago

linonetwo commented 1 year ago

截屏2023-03-09 16 02 23 截屏2023-03-09 16 02 11


externalPlugins.js:20 Error requiring /Users/linonetwo/Library/Application Support/Cerebro/plugins/node_modules/cerebro-basic-apps-chinese-abbr
externalPlugins.js:21 Error: Cannot find module 'nodobjc'
Require stack:
- /Applications/Cerebro.app/Contents/Resources/app.asar/main/index.html
    at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at i._resolveFilename (node:electron/js2c/renderer_init:33:1095)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/linonetwo/Lib…st/index.js:6957:54)
    at __webpack_require__ (/Users/linonetwo/Lib…dist/index.js:21:30)
    at Object.<anonymous> (/Users/linonetwo/Lib…st/index.js:6939:17)
externalPlugins.js:83 Plugin is not valid, skipped
externalPlugins.js:79 Load plugin: cerebro-case-styles
externalPlugins.js:80 Path: /Users/linonetwo/Library/Application Support/Cerebro/plugins/node_modules/cerebro-case-styles...
/Users/linonetwo/Lib…/dist/index.js:2128 Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in  React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs
externalPlugins.js:20 Error requiring /Users/linonetwo/Library/Application Support/Cerebro/plugins/node_modules/cerebro-case-styles
externalPlugins.js:21 Error: Cannot find module 'nodobjc'
Require stack:
- /Applications/Cerebro.app/Contents/Resources/app.asar/main/index.html
    at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at i._resolveFilename (node:electron/js2c/renderer_init:33:1095)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/linonetwo/Lib…st/index.js:4071:54)
    at __webpack_require__ (/Users/linonetwo/Lib…dist/index.js:21:30)
    at Object.<anonymous> (/Users/linonetwo/Lib…st/index.js:4054:17)
externalPlugins.js:83 Plugin is not valid, skipped

Issue

These plugins are recognized as not-installed. And have no way to remove them.

linonetwo commented 1 year ago

I have also raise issue in https://github.com/Earthen/cerebro-case-styles/issues/1 , but I didn't found this plugin rely on 'nodobjc'

Also https://github.com/cerebroapp/cerebro-osx-define/issues/2 claim it rely on 'nodobjc', and is not working properly.

linonetwo commented 1 year ago

Also get wmctrl -l Cannot open display. error from https://github.com/am-shb/cerebro-window-manager plugin, which is archived (deprecated) and not works on MacOS. It should not show in plugin list.

linonetwo commented 1 year ago

Had to manually edit /Users/linonetwo/Library/Application Support/Cerebro/plugins/package.json and run npm i in this folder.

And cause https://github.com/cerebroapp/cerebro/issues/656

ogustavo-pereira commented 1 year ago

sure I think this may have impacted by using an outdated plugin and not maintained by the team. I will understand if it is possible to somehow treat and prevent this error from happening when an error occurs in the plugin.

For now the best solution would be to delete the plugin from the plugins folder anyway

linonetwo commented 1 year ago

One possible could be reading package.json to get diff between loaded plugin and installed plugin. So it can show uninstall button properly.

ogustavo-pereira commented 1 year ago

Good, it might be a solution. Can you open a pr for me to evaluate around here?