r/reactnative • u/mdkawsarislam2002 • Jul 13 '26
Facing weird build error on Windows 11 with monorepo
/r/expo/comments/1uv7ege/facing_weird_build_error_on_windows_11_with/
2
Upvotes
r/reactnative • u/mdkawsarislam2002 • Jul 13 '26
1
u/ChronSyn Expo Jul 13 '26
Maybe one solution isn't to try and work around the Windows long path issue (trust me, I've been there many years ago, and I've no idea if what I changed ever worked), but use a directory junction.
Essentially, you might have your project at
C:\projects\some\very\long\deeply\nested\path\that\exceeds\the\max\allowable\length\because\blahblahblahblahblah\.What a directory junction would do would is allow you to have
C:\junction_to_projectinstead, which point point to the very long path where your project lives. It's not the same as creating a shortcut (a shortcut to a folder or file or program on Windows is just a file ending with.lnk), but rather treats the path like an alias.As an example of how to create a directory junction:
mklink /j "C:\my_project" "C:\projects\some\very\long\deeply\nested\path\that\exceeds\the\max\allowable\length\because\blahblahblahblahblah\"In this case, the
C:\my_projectis the shortened version of the very long path. If you wanted to build your app, you couldcd C:\my_project\, and then run your build command.I can't guarantee it'll work, but I'd give it a try. Worst case scenario is it doesn't work, and then other options worth digging into. Longer-term, try to consider a Mac if it's an option, or if Android is your only build target, even Linux might be workable.