https://facebook.github.io/react-native/blog/2017/03/13/introducing-create-react-native-app.htmlnpm run ios, launched iOS simulator with the example pagenpm run ios, got the below errorSee above steps
Error occurred running npm run ios the second time
ps.stdout.on('data', function (data) {
^
TypeError: Cannot read property 'on' of undefined
at buildProcessTree (/Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:78:14)
at /Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:99:11
at Array.forEach (native)
at ChildProcess.onClose (/Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:94:31)
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:501:12)
/Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:78
ps.stdout.on('data', function (data) {
^
TypeError: Cannot read property 'on' of undefined
at buildProcessTree (/Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:78:14)
at module.exports (/Users/gbacrna_sample/run_ios_error/node_modules/tree-kill/index.js:18:9)
at process.<anonymous> (/xdl/src/Project.js:683:5)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7)
at process.emit (/Users/gbacrna_sample/run_ios_error/node_modules/source-map-support/source-map-support.js:430:21)
at process.exit (internal/process.js:147:15)
at printErrorAndExit (/Users/gbacrna_sample/run_ios_error/node_modules/source-map-support/source-map-support.js:414:11)
at process.emit (/Users/gbacrna_sample/run_ios_error/node_modules/source-map-support/source-map-support.js:426:16)
at process._fatalException (bootstrap_node.js:284:26)
Please run these commands in the project folder and fill in their results:
npm ls react-native-scripts: [email protected] npm ls react-native:[email protected] npm ls expo:npm ERR! peer dep missing: react@>=15.3.1, required by [email protected]
npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
node -v:v7.0.0npm -v:3.10.8yarn --version: using npmwatchman version:"4.7.0"Also specify:
Hi! Thanks for the detailed report!
I'm not able to reproduce this on a fairly similar environment, so I suspect some local state is at play. Could you please try deleting your project's .expo folder and trying this again? It's used to store some information about the packager process while it's running and seems like it may have been written to incorrectly.
Removing .expo worked after a second try (didn't work for the first time), thanks for your quick tip! Its much faster to run 'npm run ios' then running the whole thing in XDE. The error in question pops up as soon Ctrl+C, there is some background process not liking it!
rm -rf .expo really solved my problem,but I need to do this everytime if I want to quit exp,and ,I found I can't use exp ba or exp bi to build standalone apps,all the same issue as @cliren
@ickma - can you give some information about your environment? I've never seen this problem before.
node -v:npm -v:yarn --version:watchman version:@brentvatne I got the same issue when crtl-c after running the packager:

yarn start yields the same error after this, until I run rm -rf .expo
This is from a clean React Native project following the basic tutorial from scratch.
Same issue as @davidhellsing, pressing ctrl-c will show the error. I also tried deleting my node_modules folder and reinstall everything but the error still shows up. I have to delete the .expo file every time I do development.
I'm running into this issue on a recently created project. Error outputs look like those shared by @davidhellsing. This project is being run on two machines. The issue affects one machine, but not the other. The setups look like:
Machine 1 (shutdown errors present)
Machine 2 (no shutdown errors)
sudo sysctl -w kern.maxfiles=5242880 && sudo sysctl -w kern.maxfilesperproc=524288I'm wondering if any of the differentiating factors b/t these two machines (yarn presence, use of nvm, macOS version, watchman) are significant?
(edited to provide more detail about watchman install differences)
we can't repro this. if someone who has a repro case can clone the repo and experiment with fixing it that would be much appreciated
Just a hacky way, not sure if this is a fix. In tree-kill module - index.js change in the onClose method.
the module will be in
change:
if (code != 0) {
to:
if (code == 0) {
And everything works.
Most helpful comment
rm -rf .exporeally solved my problem,but I need to do this everytime if I want to quit exp,and ,I found I can't useexp baorexp bito build standalone apps,all the same issue as @cliren