{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/1889","labels_url":"https://api.github.com/repos/babel/babel/issues/1889/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/1889/comments","events_url":"https://api.github.com/repos/babel/babel/issues/1889/events","html_url":"https://github.com/babel/babel/issues/1889","id":92428682,"number":1889,"title":"Require hook fails for packages installed with -g","user":{"login":"shyiko","id":370176,"avatar_url":"https://avatars.githubusercontent.com/u/370176?v=3","gravatar_id":"","url":"https://api.github.com/users/shyiko","html_url":"https://github.com/shyiko","followers_url":"https://api.github.com/users/shyiko/followers","following_url":"https://api.github.com/users/shyiko/following{/other_user}","gists_url":"https://api.github.com/users/shyiko/gists{/gist_id}","starred_url":"https://api.github.com/users/shyiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shyiko/subscriptions","organizations_url":"https://api.github.com/users/shyiko/orgs","repos_url":"https://api.github.com/users/shyiko/repos","events_url":"https://api.github.com/users/shyiko/events{/privacy}","received_events_url":"https://api.github.com/users/shyiko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-01T16:33:23Z","updated_at":"2015-07-01T16:53:26Z","closed_at":null,"body":"Say you have a CLI package which is intended to be `npm -g install`ed. Unless `require(\"babel/register\")({ignore: false})` or `require(\"babel/register\")({only: [regexp_matching_source_directory]})` is called, hook will not work (because of [src/babel/api/register/node.js:shouldIgnore](https://github.com/babel/babel/blob/master/src/babel/api/register/node.js#L91)) (global modules stored in my case in `~/.nvm/v0.10.26/lib/node_modules/...`). One way to fix this would be to add an option (e.g. `cwd`) which users could fix to (let's say) __dirname (default value is process.cwd()). There is probably a better way but... well, I though you should know."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/117748396","html_url":"https://github.com/babel/babel/issues/1889#issuecomment-117748396","issue_url":"https://api.github.com/repos/babel/babel/issues/1889","id":117748396,"user":{"login":"resistdesign","id":356375,"avatar_url":"https://avatars.githubusercontent.com/u/356375?v=3","gravatar_id":"","url":"https://api.github.com/users/resistdesign","html_url":"https://github.com/resistdesign","followers_url":"https://api.github.com/users/resistdesign/followers","following_url":"https://api.github.com/users/resistdesign/following{/other_user}","gists_url":"https://api.github.com/users/resistdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/resistdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resistdesign/subscriptions","organizations_url":"https://api.github.com/users/resistdesign/orgs","repos_url":"https://api.github.com/users/resistdesign/repos","events_url":"https://api.github.com/users/resistdesign/events{/privacy}","received_events_url":"https://api.github.com/users/resistdesign/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T16:53:26Z","updated_at":"2015-07-01T16:53:26Z","body":"It's failing to compile prompt for me"}}