react-native-builder-bob
react-native-builder-bob copied to clipboard
Running yarn doesn't work
Description
When I initialize a library with npx create-react-native-library app-structure
everything works fine, the folder is created.
But in the doc, the next step is to run yarn
, and when I run it, nothing happens. It stops directly
I tried updating yarn
to the latest version and even uninstall and reinstalling it, but it doesn't change anything.
Strangely, when I run npm install
instead of yarn, some things are installed but still, if I run npm run example web
, nothing happens.
Reproducible Demo
Simply run npx create-react-native-library app-structure
, then yarn
Description
When I initialize a library with
npx create-react-native-library app-structure
everything works fine, the folder is created. But in the doc, the next step is to runyarn
, and when I run it, nothing happens. It stops directlyI tried updating
yarn
to the latest version and even uninstall and reinstalling it, but it doesn't change anything.Strangely, when I run
npm install
instead of yarn, some things are installed but still, if I runnpm run example web
, nothing happens.Reproducible Demo
Simply run
npx create-react-native-library app-structure
, thenyarn
Hi ngab. I assume you were running this on windows, because it runs fine on MacOS. The problem is that somehow nodejs behaves differently on windows, it can't spawn the child_process automatically. Do the following:
- Go to /scripts directory in the root project
- Edit the bootstrap.js, pass the key { shell: true }
So the options would be like this:
const options = { cwd: process.cwd(), env: process.env, stdio: 'inherit', encoding: 'utf-8', shell: true, };
Then run yarn
command again, it would work normally
Can you add this in the readme, 2 hours i was clueless.
I think, a pr should be opened for this.
@lfabl Is this issue still happening for you? It seems to be already resolved: https://github.com/callstack/react-native-builder-bob/blob/3bad82db17675d366db18d8eb5d137f5d00802aa/packages/create-react-native-library/templates/common/scripts/bootstrap.js#L15
Yes, i solved with shell = true;