{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/4968","labels_url":"https://api.github.com/repos/facebook/react-native/issues/4968/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/4968/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/4968/events","html_url":"https://github.com/facebook/react-native/issues/4968","id":123828214,"number":4968,"title":"NPM modules get required from /Users/node_modules/ instead of the project directory","user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/Help%20Wanted","name":"Help Wanted","color":"5319e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/JS","name":"JS","color":"fef2c0"},{"url":"https://api.github.com/repos/facebook/react-native/labels/Tooling","name":"Tooling","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-24T18:52:47Z","updated_at":"2015-12-25T03:46:03Z","closed_at":null,"body":"There are various issues scattered around the repo related to this issue. Basically what happens is, for some packages, when you try to require `some-module` in a file, for example,\r\n\r\n```js\r\nvar someModule = require('some-module');\r\n```\r\n\r\nIt tries to require the package from home directory instead of the project's `node_modules` directory, and the following wrror appears,\r\n\r\n```sh\r\nUnable to resolve module some-module from /Users/username/projectname/AwesomeProject/index.js: Invalid directory /Users/node_modules/config\r\n```\r\n\r\nCurrently, the workarounds seem to be,\r\n\r\n- Recreate the project from scratch\r\n- Clear packager cache - `rm -fr $TMPDIR/react-*`\r\n- Clear watchman watches - `watchman watch-del-all`"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/167189053","html_url":"https://github.com/facebook/react-native/issues/4968#issuecomment-167189053","issue_url":"https://api.github.com/repos/facebook/react-native/issues/4968","id":167189053,"user":{"login":"martinbigio","id":535661,"avatar_url":"https://avatars.githubusercontent.com/u/535661?v=3","gravatar_id":"","url":"https://api.github.com/users/martinbigio","html_url":"https://github.com/martinbigio","followers_url":"https://api.github.com/users/martinbigio/followers","following_url":"https://api.github.com/users/martinbigio/following{/other_user}","gists_url":"https://api.github.com/users/martinbigio/gists{/gist_id}","starred_url":"https://api.github.com/users/martinbigio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinbigio/subscriptions","organizations_url":"https://api.github.com/users/martinbigio/orgs","repos_url":"https://api.github.com/users/martinbigio/repos","events_url":"https://api.github.com/users/martinbigio/events{/privacy}","received_events_url":"https://api.github.com/users/martinbigio/received_events","type":"User","site_admin":false},"created_at":"2015-12-25T03:46:03Z","updated_at":"2015-12-25T03:46:03Z","body":"Do we have a consistent repro case? I've experienced this too. "}}