Skip to content

feat(yarn): prefer local react-native insteda of global one using npx - #875

Closed
sibelius wants to merge 1 commit into
react-native-community:masterfrom
sibelius:feat/yarn
Closed

sibelius wants to merge 1 commit into
react-native-community:masterfrom
sibelius:feat/yarn

Conversation

@sibelius

@sibelius sibelius commented Dec 3, 2019

Copy link
Copy Markdown
Member

Summary:

run local react-native cli version, so it does not have some kind of mismatch of react-native version

Test Plan:

Run against a monorepo using yarn workspaces without nohoist option

@sibelius

sibelius commented Dec 3, 2019

Copy link
Copy Markdown
Member Author

before this fix the error was like this one

A problem occurred evaluating script.
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
  [root:/app/packages/app/android, reactNativePath:/app/node_modules/react-native, dependencies:[:], commands:[], assets:[], platforms:[:], haste:[providesModuleNodeModules:[], platforms:[]], project:[:]]

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do that. Not every project uses yarn. We may try having some kind of feature detection, but we wanted to avoid that. That's why we use globally available npx, but it seems to have issues in some environments. We would like to first understand why npx fails

@sibelius

sibelius commented Dec 3, 2019

Copy link
Copy Markdown
Member Author

can we use npm start react-native config ?

@thymikee

thymikee commented Dec 3, 2019

Copy link
Copy Markdown
Member

No, we can't. "start" usually (and likely not always, as projects differ) runs metro and won't work with extra "config" argument. Can you share a repro where the problem happens so we can investigate?

@sibelius

sibelius commented Dec 3, 2019

Copy link
Copy Markdown
Member Author

like this https://github.com/entria/entria-fullstack

but we need to remove nohoist on that

@sibelius

sibelius commented Dec 4, 2019

Copy link
Copy Markdown
Member Author

worked well here https://github.com/entria/entria-fullstack with npx

gonna need more time to figure it out why our internal repo is failing

I'm gonna reopen if I figure it out

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.

2 participants