Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native windows, spawn npm ENOENT error

I am trying to run react-native on windows and get the following error:

C:\Program Files>react-native init AwesomeProject

This will walk you through creating a new React Native project in C:\Program Fil es\AwesomeProject Installing react-native package from npm... events.js:141 throw er; // Unhandled 'error' event ^

Error: spawn npm ENOENT at exports._errnoException (util.js:860:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32) at onErrorNT (internal/child_process.js:344:16) at doNTCallback2 (node.js:450:9) at process._tickCallback (node.js:364:17) at Function.Module.runMain (module.js:459:11) at startup (node.js:136:18) at node.js:972:3

How do I fix this?

like image 421
user2950593 Avatar asked Nov 25 '25 16:11

user2950593


2 Answers

This should be fixed in React Native CLI 0.1.9. To update your CLI:

npm uninstall -g react-native-cli
npm install -g react-native-cli

There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169

like image 162
Martin Konicek Avatar answered Nov 27 '25 05:11

Martin Konicek


Check if the gradlew.bat file is present in the android folder if it is not there then simply copy gradlew.bat file from another project.

like image 26
Tapan Dabhi Avatar answered Nov 27 '25 05:11

Tapan Dabhi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!