-
Notifications
You must be signed in to change notification settings - Fork 914
Warnings emitted on init
when ran from within a non-installed package
#1493
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
Comments
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
This is still an issue. |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
This is still an issue. |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
This is still an issue. |
Environment
Description
I want to
react-native init
a new app while my current working directory is a (a sub-directory of) another package.But when I do this from within a package that has not yet been installed (or linked in the case of a Lerna mono-repo), the CLI emits confusing warnings (see example below).
I believe the root cause of these warnings is that an attempt is made to locate a root package and load its configuration (https://github.com/react-native-community/cli/blob/master/packages/cli/src/index.ts#L217) independently on what command is being executed.
The default behaviour of
loadConfig
is to find the nearestpackage.json
up the tree: https://github.com/react-native-community/cli/blob/master/packages/cli/src/tools/config/index.ts#L61 which will find the enclosing package with uninstalled dependencies.Ideally running
react-native init
shouldn't traverse my file system to determine a configuration.Most likely the commands meant to be executed "detached" from a package, should have an early return code-path to make sure the configuration is never loaded when running those.
Reproducible Demo
When running this, notice the warning emitted from the CLI:
Workaround
Users can place a
package.json
containing an empty object ({}
) in the current working directory before executing thereact-native init
command.The text was updated successfully, but these errors were encountered: