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

Don't crash if process.argv is undefined #3

Closed
wants to merge 1 commit into from

Conversation

barbogast
Copy link

process.argv is undefined within react-native apps. Adding this fallback will prevent has-flag from crashing which in turn allows the usage of packages which use this has-flag (at least if the command line arguments are not important).

In my case I would like to use envalid with react-native. envalid uses chalk, which requires supports-color which finally uses has-flag.

@barbogast
Copy link
Author

See also af/envalid#30

@sindresorhus
Copy link
Owner

This should be fixed in React Native, not in every single module using process.argv. Open an issue on React Native instead.

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

Successfully merging this pull request may close these issues.

None yet

2 participants