pmadruga / react-native-clean-project

Automating the clean up of a React Native project
MIT License
1.18k stars 52 forks source link

Unhandled error in events.js:183 #7

Closed ChargingBulle closed 6 years ago

ChargingBulle commented 6 years ago

Unhandled error in events.js:183 Sorry that's all the Information I have:

yarn run v1.3.2
$ react-native-clean-project
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn watchman ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

On Windows 10.0.16299 Enterprise

ProteanDev commented 6 years ago

Please update your Yarn to v1.6.0 and node to v9.11.1 with npm@5.7.1 Reinstall node with version 9.11.1 npm i -g npm@5.7.1 npm i -g yarn

Let us know if you can generate the same error after that

pmadruga commented 6 years ago

@JonasDralle which node version are you using?

codybrouwers commented 6 years ago

I believe we just need to cover the error case when executing the spawned task, maybe like so:

spawnedTask.stderr.on('error', error => {
  console.log(`Command execution failed with error: ${error.message}`);
});

Probably would be good to reject the promise as well so any connected tasks don't run next. I can maybe take a look this weekend at putting together a PR.

Would also be good to know the minimum node version the package works with.

sarveshcchauhan commented 6 years ago

I have got the answer and its working fine on my windows 7 OS and Genymotion Emulator or AVD emulator Vote UP if you find it useful or its working on your PC or laptots too If any error revert back Follow the below steps do not skip any steps[![enter image description here][1]][1]

1. npm install -g create-react-native-app (should be version 4)
2. yarn --version (Check yarn version should be 1.7.0)
3. create-react-native-app my_project_name
4. Downgrade npm version by applying [ npm install -g npm@4 ]
5. lOcate folder and go eg: E://my_project_name/
6. Enter npm start 
7. And after generating QR CODE press [ ctrl + C ] AND PRES [ Y ] and enter
8. enter npm run ejcet (after package stopped)
9. Choose React Native App 
10. And then enter title name for your project that to be displayed on android/ios and press enter again to start installing package
11. After successfull eject Ignore the error that you get 
12. Your Emulator must be ON
13. Now enter [ npm run android ] and automatically node cmd will open and will install the app wait for 10-15 minutes
14. ANd don't colse any CMD 

1