Installing app and trying to run using:
react-vr init MyAppName
cd MyAppName
npm start
Start server
I get an error:
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node/7.0.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 11
npm ERR!
npm ERR! Failed at the [email protected] start script 'node node_modules/react-native/local-cli/cli.js start'.
Node conveniently has no documentation around exit code 11, so I'm working a bit blindly here, but 11 is typically associated with segfaults in other contexts. I notice you're running 7.0.0. Do you mind trying to update Node? I know the RN packager had a number of issues with 7.0.0
I tried using Node v7.2.1, 6.9.2, neither work. I tried but failed running it on port 3000 as well via:
npm start --port=3000
I also get this error, which I'm not familiar with. It may just be junk, I don't know.
2016-12-15 21:14 node[31591] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-12-15 21:14 node[31591] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-12-15 21:14 node[31591] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-12-15 21:14 node[31591] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
ERROR Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
at exports._errnoException (util.js:1022:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
Hmm, they may be related. Since you're on a Mac, I recommend installing Watchman, as described here: https://facebook.github.io/react-native/docs/getting-started.html
Watchman is a much more efficient filesystem watcher than the one that ships in Node, or native solutions like chokidar. It should resolve those file-watching errors, and will definitely make the actually development much faster.
I'm assuming you've also already tried blowing away the node_modules folder and retrying npm install?
I tried blowing away node_modules on 6.9.2 and 7.2.1, and neither worked.
I installed Watchman, blew away the node-modules, npm install, and then it didn't crash. I went to the URL http://localhost:8081/vr/ and it loaded.
I don't know why that was the solution, but it might be something to add to the documentation for a later note. As of right now I use React.js, not React Native, so didn't think of that. Thanks for the help.
Thanks, I'll be sure to update the documentation to clarify that we're using the packager from React Native, and probably add a section about Watchman for Mac/Linux users. For the initial documentation, we didn't want the setup process to be too overwhelming, since things should work without Watchman, but it drastically improves the experience.
thanks @andrewimm , install watchman solve my problem
Most helpful comment
Hmm, they may be related. Since you're on a Mac, I recommend installing Watchman, as described here: https://facebook.github.io/react-native/docs/getting-started.html
Watchman is a much more efficient filesystem watcher than the one that ships in Node, or native solutions like chokidar. It should resolve those file-watching errors, and will definitely make the actually development much faster.