cerebroapp / cerebro

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

Problem installing new plugin #395

Closed mipmip closed 2 years ago

mipmip commented 6 years ago

I just created a plugin https://github.com/mipmip/cerebro-open-in-iterm by following the docs.

Issue

While developing everything worked. I published the plugin to npmjs, but now I have problems installing it with Cerebro.

[npm] Install package cerebro-open-in-iterm
main.bundle.js:1 Version: 0.1.2
main.bundle.js:1 Extract https://registry.npmjs.org/cerebro-open-in-iterm/-/cerebro-open-in-iterm-0.1.2.tgz to /Users/pim/Library/Application Support/Cerebro/plugins/node_modules/cerebro-open-in-iterm
main.bundle.js:1 Download and extract to temp path: /var/folders/q_/p2wkrhdx4wv3k41clnfjmcfr0000gp/T/cerebro-open-in-iterm
main.bundle.js:1 Move /var/folders/q_/p2wkrhdx4wv3k41clnfjmcfr0000gp/T/cerebro-open-in-iterm to /Users/pim/Library/Application Support/Cerebro/plugins/node_modules/cerebro-open-in-iterm
main.bundle.js:1 Add package to dependencies
main.bundle.js:1 Load plugin: cerebro-open-in-iterm
main.bundle.js:1 Path: /Users/pim/Library/Application Support/Cerebro/plugins/node_modules/cerebro-open-in-iterm...
main.bundle.js:1 Error requiring /Users/pim/Library/Application Support/Cerebro/plugins/node_modules/cerebro-open-in-iterm
main.bundle.js:1 Error: Cannot find module '/Users/pim/Library/Application Support/Cerebro/plugins/node_modules/cerebro-open-in-iterm'
    at Module._resolveFilename (module.js:470)
    at Function.Module._resolveFilename (/Users/pim/Desktop/Cerebro.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35)
    at Function.Module._load (module.js:418)
    at Module.require (module.js:498)
    at require (internal/module.js:20)
    at f (main.bundle.js:1)
    at setTimeout (main.bundle.js:1)
main.bundle.js:1 Plugin is not valid, skipped
KELiON commented 6 years ago

@mipmip Hey! How did you build and publish your plugin? main key in your package.json is dist/index.js, but you have only src directory, there is no dist folder published to npm.

You can check i.e. cerebro-basic-apps – it has prepublish key in package.json that clears dist folder and starts build script. And publishes your package only after that.

Also you have npmignore file, that should be merged into .npmignore (just copy content to the end of your file)

dubisdev commented 2 years ago

I'm closing this as an outdated issue. It is not really a "cerebro" issue but as a plugin issue.