Environment
$ react-native info
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
Memory: 726.04 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
Android SDK:
API Levels: 19, 27, 28
Build Tools: 27.0.3, 28.0.2
System Images: android-19 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.4/9F1027a - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: git://github.com/jyrno42/react-native.git#bf64df4aea3f8ecda3fd9cfc2ed25e9f61ac905b => 1000.0.0
npmGlobalPackages:
react-native-cli: 2.0.1
Description
I have to manually create the directory node_modules/@react-native-community/cli/scripts to get the packager to start when using RN from source. Note, the issue only occurs when running react-native run-android.
Reproducible Demo
- Clone
https://github.com/Jyrno42/rn-geoloctest
git clone git@github.com:Jyrno42/rn-geoloctest.git
yarn
yarn android
- Get the following output:
$ yarn android
yarn run v1.12.3
$ react-native run-android
Starting JS server...
ENOENT: no such file or directory, open '/Users/me/Documents/projects/rn-geoloctest/node_modules/@react-native-community/cli/scripts/.packager.env'
Error: ENOENT: no such file or directory, open '/Users/me/Documents/projects/rn-geoloctest/node_modules/@react-native-community/cli/scripts/.packager.env'
at Object.openSync (fs.js:450:3)
at Object.writeFileSync (fs.js:1212:35)
at startServerInNewWindow (/Users/me/Documents/projects/rn-geoloctest/node_modules/@react-native-community/cli/build/runAndroid/runAndroid.js:185:6)
at isPackagerRunning.then.result (/Users/me/Documents/projects/rn-geoloctest/node_modules/@react-native-community/cli/build/runAndroid/runAndroid.js:77:7)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
error Command failed with exit code 1.
- Run
mkdir node_modules/@react-native-community/cli/scripts
- Run
yarn android again, packager now starts
Environment
Description
I have to manually create the directory
node_modules/@react-native-community/cli/scriptsto get the packager to start when using RN from source. Note, the issue only occurs when runningreact-native run-android.Reproducible Demo
https://github.com/Jyrno42/rn-geoloctestgit clone git@github.com:Jyrno42/rn-geoloctest.gityarnyarn androidmkdir node_modules/@react-native-community/cli/scriptsyarn androidagain, packager now starts