After extensive research, I noticed the following in the expo.cmd
file that is generated in the app's node_modules
directory:
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\expo\bin\cli" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\..\..\..\node_modules\expo\bin\cli" %*
)
In the cases where it fails, both paths include an additional ..\
:
\..\..\..\..\..\node_modules\expo\bin\cli
This makes sense to some extent because I added another subfolder in my workspace structure. However, due to the error message, I ended up manually modifying the .cmd file and removing the additional ... After doing this, it worked as expected.
Since Expo has limited support for workspaces, I assume this is an edge case that was simply never considered or tested. My explanation is still quite vague, though, and I would appreciate it if anyone here has deeper insights into why this happens or how it can be resolved more cleanly.