{"action":"closed","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3939","labels_url":"https://api.github.com/repos/nodejs/node/issues/3939/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3939/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3939/events","html_url":"https://github.com/nodejs/node/issues/3939","id":118042630,"number":3939,"title":"require.resolve throws exception","user":{"login":"cztomsik","id":3526922,"avatar_url":"https://avatars.githubusercontent.com/u/3526922?v=3","gravatar_id":"","url":"https://api.github.com/users/cztomsik","html_url":"https://github.com/cztomsik","followers_url":"https://api.github.com/users/cztomsik/followers","following_url":"https://api.github.com/users/cztomsik/following{/other_user}","gists_url":"https://api.github.com/users/cztomsik/gists{/gist_id}","starred_url":"https://api.github.com/users/cztomsik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cztomsik/subscriptions","organizations_url":"https://api.github.com/users/cztomsik/orgs","repos_url":"https://api.github.com/users/cztomsik/repos","events_url":"https://api.github.com/users/cztomsik/events{/privacy}","received_events_url":"https://api.github.com/users/cztomsik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/feature%20request","name":"feature request","color":"0D7BDE"},{"url":"https://api.github.com/repos/nodejs/node/labels/module","name":"module","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-20T13:27:48Z","updated_at":"2015-11-22T20:19:31Z","closed_at":"2015-11-22T20:19:31Z","body":"I know it's locked but it's just silly - to just test if module is present we have to try/catch `require.resolve()`\r\n\r\nIt's not very common but it does happen and **such hacks are present even in node itself**: https://github.com/nodejs/node/blob/master/lib/repl.js#L38\r\n\r\nWould be great if we could either introduce new method or at least add `opts` hash with support for this."}}