{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/48838","repository_url":"https://api.github.com/repos/Homebrew/homebrew","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48838/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48838/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48838/events","html_url":"https://github.com/Homebrew/homebrew/issues/48838","id":131468473,"number":48838,"title":"Kibana plugin installations fail due to not finding package's Node modules","user":{"login":"ches","id":13277,"avatar_url":"https://avatars.githubusercontent.com/u/13277?v=3","gravatar_id":"","url":"https://api.github.com/users/ches","html_url":"https://github.com/ches","followers_url":"https://api.github.com/users/ches/followers","following_url":"https://api.github.com/users/ches/following{/other_user}","gists_url":"https://api.github.com/users/ches/gists{/gist_id}","starred_url":"https://api.github.com/users/ches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ches/subscriptions","organizations_url":"https://api.github.com/users/ches/orgs","repos_url":"https://api.github.com/users/ches/repos","events_url":"https://api.github.com/users/ches/events{/privacy}","received_events_url":"https://api.github.com/users/ches/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-04T20:43:03Z","updated_at":"2016-02-05T10:54:39Z","closed_at":null,"body":"```\r\n$ kibana plugin --install elastic/sense\r\nInstalling sense\r\nAttempting to transfer from https://download.elastic.co/elastic/sense/sense-latest.tar.gz\r\nTransferring 318849 bytes....................\r\nTransfer complete\r\nExtracting plugin archive\r\nExtraction complete\r\nOptimizing and caching browser bundles...\r\nPlugin installation was unsuccessful due to error \"Cannot find module 'joi'\"\r\n```\r\n\r\nFor a survey of how people don't browse issues before reporting :grin:, see:\r\n\r\n  - elastic/sense#93\r\n  - elastic/sense#94\r\n  - elastic/sense#96\r\n\r\nA quick and dirty kludge to fix this is to symlink the `node_modules` alongside the plugin directory created and symlinked by the formula:\r\n\r\n```patch\r\ndiff --git a/Library/Formula/kibana.rb b/Library/Formula/kibana.rb\r\nindex 268d251..5e9f4b6 100644\r\n--- a/Library/Formula/kibana.rb\r\n+++ b/Library/Formula/kibana.rb\r\n@@ -65,6 +65,7 @@ class Kibana < Formula\r\n\r\n     (var/\"lib/kibana/installedPlugins\").mkpath\r\n     ln_s var/\"lib/kibana/installedPlugins\", prefix/\"installedPlugins\"\r\n+    ln_s prefix/\"node_modules\", var/\"lib/kibana/node_modules\"\r\n   end\r\n\r\n   plist_options :manual => \"kibana\"\r\n```\r\n\r\nBut that probably isn't the *right* fix. I haven't grokked how the plugin installation works yet (beyond a hand-wavy \"something npm\"), just wanted to get the issue reported.\r\n\r\nIt would be nice to leave plugins in place when users upgrade Kibana, which must be the intent of the `installedPlugins` symlink that's used now. If the plugins share `node_modules` with Kibana itself, though, and have implicit dependencies on libs Kibana uses—the `sense` plugin does not explicitly declare an npm dep on `joi` or anything else, which might be a discussion to raise upstream—then this might become a mess across upgrades.\r\n\r\n#46593 is relevant for history of the package-local copy of Node."},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/180293822","html_url":"https://github.com/Homebrew/homebrew/issues/48838#issuecomment-180293822","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48838","id":180293822,"user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"created_at":"2016-02-05T10:54:38Z","updated_at":"2016-02-05T10:54:38Z","body":"> But that probably isn't the right fix. I haven't grokked how the plugin installation works yet (beyond a hand-wavy \"something npm\"), just wanted to get the issue reported.\r\n\r\nFWIW that seems fine to me. CC @jasontedor who may have better ideas."}}