Use node to resolve react-native package path#2284
Use node to resolve react-native package path#2284youedd wants to merge 1 commit intomicrosoft:masterfrom
Conversation
|
Hi @youedd , thank you for the contribution! If I understand correctly, this solution will work only if appcenter-cli is added to your react-native project as a dependency. What if we use it as a globally installed tool? |
|
Hello @DmitriyKirakosyan, Installing the appcenter-cli globally or locally shouldn't have an impact. The appcenter-cli/src/commands/codepush/release-react.ts Lines 134 to 138 in 32a624b appcenter-cli/src/commands/codepush/lib/react-native-utils.ts Lines 594 to 615 in 32a624b In case the resolved path does not exist, it will fallback to the current logic. appcenter-cli/src/commands/codepush/lib/react-native-utils.ts Lines 580 to 587 in 041522a |
|
@youedd thank you for the clarification. You are right. However, the fallback doesn't work. If the process throws an error, it will return empty string in Also, probably worth adding a timeout to |
|
Merged with a needful changes as #2305 |
We were facing issues with the appcenter cli after migrating our react-native project to a mono-repository.
The cli is looking for react-native package is in the project node_modules folder instead of the root node_modules, which leads to errors.
This PR aims to solve that by using node's
require.resolveto find the package path.