{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/3","repository_url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch","labels_url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/3/comments","events_url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/3/events","html_url":"https://github.com/Microsoft/edge-diagnostics-launch/pull/3","id":150592318,"number":3,"title":"Search all module paths for the adapter executable","user":{"login":"caspervonb","id":157787,"avatar_url":"https://avatars.githubusercontent.com/u/157787?v=3","gravatar_id":"","url":"https://api.github.com/users/caspervonb","html_url":"https://github.com/caspervonb","followers_url":"https://api.github.com/users/caspervonb/followers","following_url":"https://api.github.com/users/caspervonb/following{/other_user}","gists_url":"https://api.github.com/users/caspervonb/gists{/gist_id}","starred_url":"https://api.github.com/users/caspervonb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caspervonb/subscriptions","organizations_url":"https://api.github.com/users/caspervonb/orgs","repos_url":"https://api.github.com/users/caspervonb/repos","events_url":"https://api.github.com/users/caspervonb/events{/privacy}","received_events_url":"https://api.github.com/users/caspervonb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-23T20:12:21Z","updated_at":"2016-04-26T01:56:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/pulls/3","html_url":"https://github.com/Microsoft/edge-diagnostics-launch/pull/3","diff_url":"https://github.com/Microsoft/edge-diagnostics-launch/pull/3.diff","patch_url":"https://github.com/Microsoft/edge-diagnostics-launch/pull/3.patch"},"body":"Resolving relative to the current working directory won't do much good (as in it will fail once you install this as a module in another module).\r\n\r\nIn other words, this happens\r\n```console\r\n$ git clone https://github.com/microsoft/edge-diagnostics-launch.git\r\n$ cd edge-diagnostics-launch/examples\r\n$ node example\r\n\r\nError: spawn .../edge-diagnostics-launch/examples/node_modules/edge-diagnostics-adapter/dist/x64/EdgeDiagnosticsAdapter.exe ENOENT\r\n```\r\n\r\nThis searches through all the paths in `module.paths` for the adapter\r\ninstead.  Should work with both npm v2 and npm v3 as all the directories are checked from the most local to the least local."},"comment":{"url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/comments/214584193","html_url":"https://github.com/Microsoft/edge-diagnostics-launch/pull/3#issuecomment-214584193","issue_url":"https://api.github.com/repos/Microsoft/edge-diagnostics-launch/issues/3","id":214584193,"user":{"login":"caspervonb","id":157787,"avatar_url":"https://avatars.githubusercontent.com/u/157787?v=3","gravatar_id":"","url":"https://api.github.com/users/caspervonb","html_url":"https://github.com/caspervonb","followers_url":"https://api.github.com/users/caspervonb/followers","following_url":"https://api.github.com/users/caspervonb/following{/other_user}","gists_url":"https://api.github.com/users/caspervonb/gists{/gist_id}","starred_url":"https://api.github.com/users/caspervonb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caspervonb/subscriptions","organizations_url":"https://api.github.com/users/caspervonb/orgs","repos_url":"https://api.github.com/users/caspervonb/repos","events_url":"https://api.github.com/users/caspervonb/events{/privacy}","received_events_url":"https://api.github.com/users/caspervonb/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T01:56:22Z","updated_at":"2016-04-26T01:56:22Z","body":"Seems like a total overkill? It's not even clear to me how the resolution is done when when looking at https://github.com/substack/node-resolve/blob/master/lib/sync.js, where-as this is as clear as it can be. Could rewrite it as a `module.paths.reduce` call but still only 3 lines of code :wink: \r\n\r\nLets not run into a left-pad situation with trivial code? :stuck_out_tongue_winking_eye: "}}