Skip to content
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

Create examples with npx instead of globally installed react-native-cli #265

Closed
arniu opened this issue Mar 2, 2020 · 4 comments
Closed

Comments

@arniu
Copy link

arniu commented Mar 2, 2020

According to react-native-community/cli:

Using npx (recommended)

Available since react-native@0.60

This method is preferred if you don't want to install global packages.

npx react-native init MyApp
@brodycj
Copy link
Owner

brodycj commented Mar 2, 2020

Thanks for the proposal. I generally do not like waiting for npx to download each tool every time I want to run it, and I would still count running npx as use of an external tool.

I am thinking that using @react-native-community/cli as discussed in #204, or even using cli.js from react-native itself as I said in #204 (comment), would be a better solution. I just pinned #204 in first place, to hopefully get it resolved in the near future, closing this one for now.

@brodycj brodycj closed this as completed Mar 2, 2020
@arniu
Copy link
Author

arniu commented Mar 3, 2020

Yes, npx will download the tool, and then cache it.

So for the people who use it again and again, they will not wait any more.
For the people who use it only once, downloading is inevitable. By npx, or by hand, downloading always go.

Moreover, npx will be the best solution for the ones who have no permission to install global packages.

@arniu
Copy link
Author

arniu commented Mar 3, 2020

As for @react-native-community/cli, it is not intended to install globally.

@brodycj
Copy link
Owner

brodycj commented Mar 4, 2020

@arniu that is all correct. I still really do not like the idea of any tools like this one suddenly installing its dependencies via npx. The idea discussed in #204 would be to add @react-native-community/cli as a package dependency. But I am still open to discuss alternatives and ideas that users may have. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants