I try create a react-app with npx create-native init project but the react version was 17.0.2. I used npm install react react-dom( following https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html) to update for the new version but now I received the message when I try create a nem project: npm ERR! could not determine executable to run.
What should I do?
log:
38 verbose stack Error: could not determine executable to run 38 verbose stack at getBinFromManifest (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\get-bin-from-manifest.js:17:23) 38 verbose stack at exec (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\index.js:135:15) 38 verbose stack at async module.exports (C:\Users\55319\AppData\Roaming\npm\node_modules\npm\lib\cli.js:78:5) 39 verbose pkgid create-native@1.0.0 40 verbose cwd C:\Users\55319 41 verbose Windows_NT 10.0.19044 42 verbose node v16.15.0 43 verbose npm v8.8.0 44 error could not determine executable to run 45 verbose exit 1 46 timing npm Completed in 2369ms 47 verbose code 1 48 error A complete log of this run can be found in: 48 error C:\Users\55319\AppData\Local\npm-cache_logs\2022-05-12T01_59_05_028Z-debug-0.log CMD
It installed that version because that's the version it's compatible with, as of this writing (RN 68.1). React Native often doesn't use the latest version of React. If you open up the changelog for React Native and search for React 17, you'll see it was introduced into React Native version 64.0. There are no hits for React 18 because it hasn't yet been integrated.