equinor / react-native-msal

MSAL for React Native
MIT License
2 stars 3 forks source link

Cannot run "npm install" on projects that use this fork of react-native-msal without having yarn installed #12

Closed tormodAase closed 9 months ago

tormodAase commented 1 year ago

Bug Description: If a project uses this fork as a dependency, npm install won't work unless you have yarn installed on your machine.

Steps To Reproduce:

Expected Behavior: Installation of packages should work just fine

Environment Information:

Additional Information: I believe this happens because we use this package directly from github, without building it first.

tormodAase commented 1 year ago

The bug was found by Henning. @dansvend @HaakonSvane

Goostavo commented 1 year ago

Related to the bootstrap file and the package.json. Both are using commands that depends on Yarn.

This discussion on Stack Overflow show two nice solutions. Using the environment variable that holds the default npm or yarn, or adding a small dev module to the project that detects and uses the default. https://stackoverflow.com/questions/41647961/package-json-scripts-that-work-with-npm-and-yarn

MAgungHKM commented 1 year ago

From my findings, the root cause is expo-module-scripts. That package has npx bash file which supposed to detect wether you use yarn exec or npx, but the if condition appears to be incorrect, as we can see over at https://github.com/expo/expo/commit/d295e37d1e623ca8abe067ae7dbb2841bc81e96d.

So either update the expo-modules-scripts package or apply a patch-package to that specific bash file.