Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 25.2k
[Workarounds] Packager unable to resolve module from /Users/node_modules/ #4968
Copy link
Copy link
Closed
Labels
BugHelp Wanted
Issues ideal for external contributors.Issues ideal for external contributors.JavaScriptResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.Tech: Bundler 📦This issue is related to the bundler (Metro, Haul, etc) used.This issue is related to the bundler (Metro, Haul, etc) used.📮Known IssuesThis indicates an issue that refers to a bug or limitation of RN that is not currently being handledThis indicates an issue that refers to a bug or limitation of RN that is not currently being handled
Description
Metadata
Metadata
Assignees
Labels
BugHelp Wanted
Issues ideal for external contributors.Issues ideal for external contributors.JavaScriptResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.Tech: Bundler 📦This issue is related to the bundler (Metro, Haul, etc) used.This issue is related to the bundler (Metro, Haul, etc) used.📮Known IssuesThis indicates an issue that refers to a bug or limitation of RN that is not currently being handledThis indicates an issue that refers to a bug or limitation of RN that is not currently being handled
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-modulein a file, for example,It is unable to resolve the package and the following error appears,
This error message is a symptom of the packager not being able to find
some-module. It'll walk up the directory tree until it findsnode_modules/some-module. It just so happens that/Usersis the last directory to try, hence the weird/Users/node_modulesdirectory in the error message (h/t @philikon).Workarounds
Currently, the workarounds seem to be,
node_modulesfolder -rm -rf node_modules && npm installrm -fr $TMPDIR/react-*ornode_modules/react-native/packager/packager.sh --reset-cachewatchman watch-del-all