{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/4968","repository_url":"https://api.github.com/repos/facebook/react-native","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://avatars2.githubusercontent.com/u/1174278?v=4","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":[{"id":267325512,"url":"https://api.github.com/repos/facebook/react-native/labels/Help%20Wanted","name":"Help Wanted","color":"5319e7","default":false},{"id":257498156,"url":"https://api.github.com/repos/facebook/react-native/labels/JS","name":"JS","color":"fef2c0","default":false},{"id":298628022,"url":"https://api.github.com/repos/facebook/react-native/labels/Tooling","name":"Tooling","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"martinbigio","id":535661,"avatar_url":"https://avatars1.githubusercontent.com/u/535661?v=4","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},"assignees":[{"login":"martinbigio","id":535661,"avatar_url":"https://avatars1.githubusercontent.com/u/535661?v=4","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}],"milestone":null,"comments":459,"created_at":"2015-12-24T18:52:47Z","updated_at":"2018-02-08T13:37:44Z","closed_at":null,"author_association":"COLLABORATOR","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,\n\n``` js\nvar someModule = require('some-module');\n```\n\nIt tries to require the package from home directory instead of the project's `node_modules` directory, and the following wrror appears,\n\n``` sh\nUnable to resolve module some-module from /Users/username/projectname/AwesomeProject/index.js: Invalid directory /Users/node_modules/some-module\n```\n\nCurrently, the workarounds seem to be,\n- Delete the `node_modules` folder - `rm -rf node_modules && npm install`\n- Reset packager cache - `rm -fr $TMPDIR/react-*` or `node_modules/react-native/packager/packager.sh --reset-cache`\n- Clear watchman watches - `watchman watch-del-all`\n- Recreate the project from scratch\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/364113402","html_url":"https://github.com/facebook/react-native/issues/4968#issuecomment-364113402","issue_url":"https://api.github.com/repos/facebook/react-native/issues/4968","id":364113402,"user":{"login":"Vadorequest","id":3807458,"avatar_url":"https://avatars2.githubusercontent.com/u/3807458?v=4","gravatar_id":"","url":"https://api.github.com/users/Vadorequest","html_url":"https://github.com/Vadorequest","followers_url":"https://api.github.com/users/Vadorequest/followers","following_url":"https://api.github.com/users/Vadorequest/following{/other_user}","gists_url":"https://api.github.com/users/Vadorequest/gists{/gist_id}","starred_url":"https://api.github.com/users/Vadorequest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vadorequest/subscriptions","organizations_url":"https://api.github.com/users/Vadorequest/orgs","repos_url":"https://api.github.com/users/Vadorequest/repos","events_url":"https://api.github.com/users/Vadorequest/events{/privacy}","received_events_url":"https://api.github.com/users/Vadorequest/received_events","type":"User","site_admin":false},"created_at":"2018-02-08T13:37:44Z","updated_at":"2018-02-08T13:37:44Z","author_association":"NONE","body":"Definitely not related to react-native... Running into this as well with react, installing some new dependencies seems to blow up my app. Really frustrating."}}
{"actor":{"display_login":"Vadorequest"}}