{"action":"created","issue":{"url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/5","labels_url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/5/comments","events_url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/5/events","html_url":"https://github.com/nparashuram/cordova-plugin-browsersync/issues/5","id":116019212,"number":5,"title":"opts.forEach is not a function","user":{"login":"roblav96","id":1457327,"avatar_url":"https://avatars.githubusercontent.com/u/1457327?v=3","gravatar_id":"","url":"https://api.github.com/users/roblav96","html_url":"https://github.com/roblav96","followers_url":"https://api.github.com/users/roblav96/followers","following_url":"https://api.github.com/users/roblav96/following{/other_user}","gists_url":"https://api.github.com/users/roblav96/gists{/gist_id}","starred_url":"https://api.github.com/users/roblav96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roblav96/subscriptions","organizations_url":"https://api.github.com/users/roblav96/orgs","repos_url":"https://api.github.com/users/roblav96/repos","events_url":"https://api.github.com/users/roblav96/events{/privacy}","received_events_url":"https://api.github.com/users/roblav96/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-11-10T03:43:18Z","updated_at":"2015-11-12T03:39:32Z","closed_at":null,"body":"Following your video directly and I can't do\r\n```\r\ncordova run\r\n```\r\nIt says:\r\n```\r\nERROR running one or more of the platforms: TypeError: opts.forEach is not a function\r\nYou may not have the required environment or OS to run this project\r\n```\r\n\r\nAny ideas?\r\n\r\n```\r\nCordova CLI: 5.4.0\r\nGulp version:  CLI version 3.9.0\r\nGulp local:  \r\nios-deploy version: 1.8.2 \r\nios-sim version: 5.0.3 \r\nOS: Mac OS Yosemite\r\nNode Version: v4.2.1\r\nXcode version: Xcode 7.1 Build version 7B91b \r\n```"},"comment":{"url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/comments/155987389","html_url":"https://github.com/nparashuram/cordova-plugin-browsersync/issues/5#issuecomment-155987389","issue_url":"https://api.github.com/repos/nparashuram/cordova-plugin-browsersync/issues/5","id":155987389,"user":{"login":"axemclion","id":17868,"avatar_url":"https://avatars.githubusercontent.com/u/17868?v=3","gravatar_id":"","url":"https://api.github.com/users/axemclion","html_url":"https://github.com/axemclion","followers_url":"https://api.github.com/users/axemclion/followers","following_url":"https://api.github.com/users/axemclion/following{/other_user}","gists_url":"https://api.github.com/users/axemclion/gists{/gist_id}","starred_url":"https://api.github.com/users/axemclion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axemclion/subscriptions","organizations_url":"https://api.github.com/users/axemclion/orgs","repos_url":"https://api.github.com/users/axemclion/repos","events_url":"https://api.github.com/users/axemclion/events{/privacy}","received_events_url":"https://api.github.com/users/axemclion/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T03:39:32Z","updated_at":"2015-11-12T03:39:32Z","body":"I fixed this issue here - https://github.com/nparashuram/cordova-plugin-browsersync/commit/4b8f98a5a87e0e8707198b4f92f5cdffec1bec23\r\n\r\nLooks like the way I was getting options from the command line was messed up - i thought context.opts.options should work, but look like there is another argv option there. This is needed so that the plugin is activated only when you call it with `-- --live-reload` (Note the double dashes). The plugin should not be called any other time since it changes the `<content src=\"index.html\">` in every platform's `config.xml` to point to the browsersync server. \r\n\r\nWe also need to pass options to let a user ignore watching certain files. Also, note that changing any file calls prepare, which invokes this plugin - that is the reason you get the error about `Error: listen EADDRINUSE :::3004` when you disabled it. This is the same problem with your code, when you call prepare as a part of the after-prepare hook. You need a way to not call the same hook from when the files are changed. \r\n\r\nWith the fix above, you should be good. Please let me know if that works. \r\n \r\nBtw, I hangout in the Cordova slack channel here - http://cordova.slack.com/. I am `axemclion`. So feel free to ping me if this is still an issue. "}}