expo / create-react-native-app Goto Github PK
View Code? Open in Web Editor NEWCreate React Native apps that run on iOS, Android, and web
License: BSD 3-Clause "New" or "Revised" License
Create React Native apps that run on iOS, Android, and web
License: BSD 3-Clause "New" or "Revised" License
warning react-native-scripts > xdl > [email protected]: use uuid module instead
warning react-native-scripts > match-require > [email protected]: use uuid module instead
warning react-native-scripts > xdl > @exponent/ngrok > [email protected]: use uuid module instead
warning react-native-scripts > xdl > auth0-js > xtend > [email protected]:
If it's a fresh project, warm both.
Figure out a way to save which platform was last requested. On subsequent starts, only warm the cache with the last requested platform.
Sometimes the port held by the manifest server or the React Native packager doesn't get released on exit. I suspect that this may be due to me being abusive in my dev environment, but it would be good for someone else to take a look at the exit hooks to see if there's a better way to do this.
OS Info:
± lsb_release -a
No LSB modules are available.
Distributor ID: neon
Description: KDE neon LTS User Edition 5.8
Release: 16.04
Codename: xenial
Run:
$ create-react-native-app my-app
$ cd my-app/
$ yarn start
Output:
± yarn start
yarn start v0.21.3
$ react-native-scripts start
Starting packager...
***ERROR STARTING PACKAGER***
Starting React Native packager...
Scanning 777 folders for symlinks in /home/cj/apps/react-native/my-app/node_modules (4ms)
Running packager on port 19001
Looking for JS files in
/home/cj/apps/react-native/my-app
React packager ready.
jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
Error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1489464468: inotify-add-watch(/home/cj/apps/react-native/my-app) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
***ERROR STARTING PACKAGER***
ERROR A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1489464468: inotify-add-watch(/home/cj/apps/react-native/my-app) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
{"watchmanResponse":{"version":"4.7.0","error":"A non-recoverable condition has triggered. Watchman needs your help!\nThe triggering condition was at timestamp=1489464468: inotify-add-watch(/home/cj/apps/react-native/my-app) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\nAll requests will continue to fail with this message until you resolve\nthe underlying problem. You will find more information on fixing this at\nhttps://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n"}}
***ERROR STARTING PACKAGER***
Error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1489464468: inotify-add-watch(/home/cj/apps/react-native/my-app) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch
at ChildProcess.<anonymous> (/home/cj/apps/react-native/my-app/node_modules/fb-watchman/index.js:207:21)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
Done in 12.14s.
Hey, folks! I couldn't install it neither with Node v6.6.0 nor v7.7.1. Here's the log:
Creating a new React Native app in /home/vinicius/Documents/code/my-app.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn add v0.20.3
info No lockfile found.
[1/4] Resolving packages...
warning react-native-scripts > xdl > [email protected]: use uuid module instead
warning react-native-scripts > xdl > @exponent/ngrok > [email protected]: use uuid module instead
warning react-native-scripts > xdl > auth0-js > xtend > [email protected]:
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/5] ⠄ @exponent/ngrok: ngrok - downloading binary https://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-linux-amd64.tgz ...
[-/5] ⠄ waiting...
[3/5] ⠄ ref: '-Goutput_dir=.' ]
[4/5] ⠄ runas: '-Goutput_dir=.' ]
warning Error running install script for optional dependency: "/home/vinicius/Documents/code/my-app/node_modules/runas: Command failed.\nExit code: 1\nCommand: sh\nArguments: -c node-gyp rebuild\nDirectory: /home/vinicius/Documents/code/my-app/node_modules/runas\nOutput:\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | linux | x64\ngyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR\ngyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR\ngyp info spawn /usr/bin/python2\ngyp info spawn args [ '/usr/share/yarn/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args 'binding.gyp',\ngyp info spawn args '-f',\ngyp info spawn args 'make',\ngyp info spawn args '-I',\ngyp info spawn args '/home/vinicius/Documents/code/my-app/node_modules/runas/build/config.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/usr/share/yarn/node_modules/node-gyp/addon.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/home/vinicius/.node-gyp/7.7.1/include/node/common.gypi',\ngyp info spawn args '-Dlibrary=shared_library',\ngyp info spawn args '-Dvisibility=default',\ngyp info spawn args '-Dnode_root_dir=/home/vinicius/.node-gyp/7.7.1',\ngyp info spawn args '-Dnode_gyp_dir=/usr/share/yarn/node_modules/node-gyp',\ngyp info spawn args '-Dnode_lib_file=node.lib',\ngyp info spawn args '-Dmodule_root_dir=/home/vinicius/Documents/code/my-app/node_modules/runas',\ngyp info spawn args '--depth=.',\ngyp info spawn args '--no-parallel',\ngyp info spawn args '--generator-output',\ngyp info spawn args 'build',\ngyp info spawn args '-Goutput_dir=.' ]\ngyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR\ngyp info spawn make\ngyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]\nmake: Entering directory '/home/vinicius/Documents/code/my-app/node_modules/runas/build'\n CXX(target) Release/obj.target/runas/src/main.o\nmake: g++: Command not found\nmake: *** [Release/obj.target/runas/src/main.o] Error 127\nrunas.target.mk:96: recipe for target 'Release/obj.target/runas/src/main.o' failed\nmake: Leaving directory '/home/vinicius/Documents/code/my-app/node_modules/runas/build'\ngyp ERR! build error \ngyp ERR! stack Error: `make` failed with exit code: 2\ngyp ERR! stack at ChildProcess.onExit (/usr/share/yarn/node_modules/node-gyp/lib/build.js:276:23)\ngyp ERR! stack at emitTwo (event[1/5] ⡀ @exponent/ngrok: ngrok - downloading binary https://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-linux-amd64.tgz ...
[-/5] ⡀ waiting...
[3/5] ⡀ ref: '-Goutput_dir=.' ]
[4/5] ⡀ runas: ERR! not ok
error /home/vinicius/Documents/code/my-app/node_modules/ref: Command failed.
Exit code: 1
Command: sh
Arguments: -c node-gyp rebuild
Directory: /home/vinicius/Documents/code/my-app/node_modules/ref
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/share/yarn/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/vinicius/Documents/code/my-app/node_modules/ref/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/share/yarn/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/vinicius/.node-gyp/7.7.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/vinicius/.node-gyp/7.7.1',
gyp info spawn args '-Dnode_gyp_dir=/usr/share/yarn/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/vinicius/Documents/code/my-app/node_modules/ref',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/vinicius/Documents/code/my-app/node_modules/ref/build'
CXX(target) Release/obj.target/binding/src/binding.o
make: g++: Command not found
binding.target.mk:94: recipe for target 'Release/obj.target/binding/src/binding.o' failed
make: Leaving directory '/home/vinicius/Documents/code/my-app/node_modules/ref/build'
make: *** [Release/obj.target/binding/src/binding.o] Error 127
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/yarn/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-21-generic
gyp ERR! command "/home/vinicius/.nvm/versions/node/v7.7.1/bin/node" "/usr/share/yarn/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vinicius/Documents/code/my-app/node_modules/ref
gyp ERR! node -v v7.7.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
`yarnpkg add --dev --exact react-native-scripts` failed
Currently the scripts will continue to use react-native-scripts, which won't work correctly with the detached client.
I'm going to track a checklist here of documentation items for the README, template project README, and other places. By no means exhaustive.
--scripts-version
& npm link for developmentRight now, only the last device to connect to the packager will live reload in most cases. Because live reloading uses polling (IIRC), this doesn't make that much sense. Needs investigation, an RCA, and a fix.
I broke the shortened cd your-project
output at some point recently. Need to fix.
I'am was very pleased at create react native-app
But I can't run npm run ios, instead got message like "osascript -e tell app "System Events" to count processes whose name is "Simulator"
IOS simulator was opened, But they didn't give me screen of react native app, but can see normal IOS Screen.
what's the problem?
cc @nikki93
It breaks on this gist:
https://gist.github.com/anonymous/0e8ec441c797a03e5265c9fd1f53d1c6
Need to diagnose and do the AST traversal in a less fragile manner.
In theory, everything has been set up to work cross platform, but I haven't run it on Windows yet and support may be flaky or problematic.
Using AppVeyor or something similar would probably be good too (cc #2).
The ability to run locally is super important. We already have npm run ios
, but we need the equivalent for Android!
If I have both simulator and a device opened on the same app, it won't update both if at least one of them has "Hot Reloading" enabled.
Probably need to rewrite this check using the AST and excluding any imports that are only used for registerRootComponent
. I'm guessing that it will be possible to cargo cult some of the jscodeshift work I already did.
Is there support for adding in environment variables like create-react-app allows? I tried it the way I usually do and it didn't work, but not sure if there is something in expo that allows it.
I get this error when i want to create a new app.
Creating a new React Native app in /Users/williamschrauwen/ReactNative/willappreciate.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn add v0.21.3
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning react-native-scripts > xdl > [email protected]: use uuid module instead
warning react-native-scripts > xdl > @exponent/ngrok > [email protected]: use uuid module instead
warning react-native-scripts > xdl > auth0-js > xtend > [email protected]:
[2/4] 🚚 Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=6".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
yarnpkg add --dev --exact react-native-scripts
failed
The HelloWorld template project in react-native/local-cli currently assumes that there will be two entry points: index.ios.js
and index.android.js
. CRNA projects start with a single main.js
(although this is fungible and could easily be called index.js
), which breaks on iOS (haven't tested Android) once ejected to a regular RN project.
For now I'm implementing some dirty hacks around this, but would like to make the upstream template project(s) compatible with CRNA's eject in the near term. I think this will just require a PR that I don't have bandwidth to write and push through right now.
EDIT: this wouldn't just require unifying the files, it looks like test and example code (and maybe docs?) assume that these files will be separate.
After creating an app and running yarn start
the QR code gives no feedback when scanning on my iPhone.
cc @mkonicek
xdl:
warning react-native-scripts > xdl > [email protected]: use uuid module instead
warning react-native-scripts > xdl > ngrok > [email protected]: use uuid module instead
react-native (I think the second is also from RN transitively, but I haven't investigated):
warning react-native > xcode > [email protected]: use uuid module instead
warning "[email protected]" has incorrect peer dependency "react@^15.4.2".
This is ugly in every way imaginable:
^C
Stopping packager...
130 adam@iceblade ~/testcrna
$ Packager stopped.
Need to return a 0 exit code if the user initiated the shutdown, and need to print 'Packager stopped.' before the new prompt is printed.
It might be good to improve tests in the template project so that they actually serve as an example to a new user how to test their app/components/etc. Right now there's just a no-op test.
We should still display a QR code and URL, along with information about downloading the app to a physical device.
Hey new to this repo and the react native ecosystem. what's the best way to get started?
I am able to get my app up and running but how to get the Debug in Chrome Developer tools?
The only option that seems to work on the device is two finger touch and then "reload" but there seems to be no option any more for remote debug....?
When create-react-native-app my-project, after a while, I get:
npm ERR! fetch failed https://github.com/exponent/react-native-maps/archive/v0.12.2-exp.1.tar.gz
Linux 4.4.0-66-generic
node v7.7.2
npm v4.1.2
I don't know if it's a npm problem or create-react-native-app issue.
It seems like create-react-native app has some issues with "react-native-elements". I've tried 2 scenarios which both produces the same error:
npm i react-native-elements --save
npm run ios
npm i react-native-vector-icons --save && react-native link react-native-vector-icons
npm i react-native-elements --save
npm run ios
In both test the simulator throws this warning. I've tried to run the commands described in the error message, but with no luck :(
2/9/2017, 9:24:18 PM: Warning: Not using the Exponent fork of react-native. See https://docs.getexponent.com/.
Needs a branch or some other change here:
https://github.com/exponent/xdl/blob/master/src/project/Doctor.js#L176
Inheriting stdout is how CRNA shows init status to the developer, but maybe it should be buffered until we're sure that yarn is installed for the "attempt installing with yarn first" version. Or maybe it's OK to just show this -- there's a lot of other output users see immediately after.
This is going to cause issues for people who build non-trivial things with CRNA.
per @brentvatne the Exponent preset will mess with some RN libs, so we need to change the preset (and corresponding dev dep I think) when we eject.
Currently the template project is init'd with the Exponent fork of react-native:
Ideally this would use the plain ol' react-native dependency from npm.
cc @ide
Not sure if this should go here or somewhere else but on the iOS mobile app when I try to open an app from clipboard that doesn't exist I get an error which is expected because it doesn't exist, but my only option is to Try Again. The only way to exit this screen is to close the app.
Right now the npm pages are incredibly non-descript.
It would be nice to eventually have an option to substitute a different project template. I don't think this should be in a first (or second even) release, but wanted to put the idea down somewhere.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.