-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(expo): use node resolution when invoking @expo/cli
from expo
#23220
Conversation
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will probably reveal a new set of issues related to expo/cli not being in the project, but this seems like a logical next step.
|
||
# Forward all arguments to the local CLI (@expo/cli). | ||
npm exec --no-install -- expo-internal "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other remaining references to expo-internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this was the only one within expo
. @expo/cli
still exports the binary as expo-internal
which might still be useful to keep around for dev.
Co-authored-by: James Ide <ide@users.noreply.github.com>
As long as it's a dependency of |
…23220) # Why Fixes #23194 We've had reports of package managers being unable to resolve the `@expo/cli` when executing from the `expo` package. - #23193 - #23194 I've had a similar experience with pnpm and yarn v1 and workspaces with `"noHoist": ["**"]`. This should fix some parts of that. <details><summary>vscode-expo fixtures issue I ran into</summary> <img width="754" alt="image" src="https://github.com/expo/expo/assets/1203991/92324113-5a1a-44ae-a573-ba2582c5d2e9"> </details> > **Note** > I've tested this in: https://github.com/byCedric/being-productive-can-have-many-reasons/blob/main/ISSUES.md (a repository with fixes required for pnpm). You can clone that repository, and try it yourself. Make sure you always install with `pnpm install`, because the patches are only set for pnpm. # How Instead of creating a new process, either through `spawnAsync` or `npm exec`, we just execute the `@expo/cli` in the process of the `expo` bin. By letting Node resolve this, it should avoid issues with complex patterns such as [isolated modules](https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md) too. # Test Plan - `$ yarn create expo ./test-bin -t tabs@beta` - `$ cd ./test-bin` - `$ rm -rf node_modules yarn.lock` - _Any of these commands should work:_ - `$ yarn install && yarn expo --help` (yarn v1) - `$ npm install && npx expo --help` (any npm version) - `$ pnpm install && pnpm expo --help` (any pnpm version) # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com> Co-authored-by: James Ide <ide@users.noreply.github.com>
Backported the fix to |
Why
Fixes #23194
We've had reports of package managers being unable to resolve the
@expo/cli
when executing from theexpo
package.w
to open browser #23252I've had a similar experience with pnpm and yarn v1 and workspaces with
"noHoist": ["**"]
. This should fix some parts of that.vscode-expo fixtures issue I ran into
How
Instead of creating a new process, either through
spawnAsync
ornpm exec
, we just execute the@expo/cli
in the process of theexpo
bin.By letting Node resolve this, it should avoid issues with complex patterns such as isolated modules too.
Test Plan
$ yarn create expo ./test-bin -t tabs@beta
$ cd ./test-bin
$ rm -rf node_modules yarn.lock
$ yarn install && yarn expo --help
(yarn v1)$ npm install && npx expo --help
(any npm version)$ pnpm install && pnpm expo --help
(any pnpm version)Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).