Error: spawn npx ENOENTat ChildProcess._handle.onexit (node:internal/child_process:285:19)
You are getting below error in react native.
PS D:\ReactNativeProject> npx react-native init InsuranceApp
⚠️ The `init` command is deprecated.
The behavior will be changed on 31/12/2024 (28 days).
- Switch to npx @react-native-community/cli init for the identical behavior.
- Refer to the documentation for information about alternative tools: https://reactnative.dev/docs/getting-started
Running: npx @react-native-community/cli init
node:events:496
throw er; // Unhandled 'error' event
^
Error: spawn npx ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npx',
path: 'npx',
spawnargs: [ '@react-native-community/cli@latest', 'init', 'InsuranceApp' ]
}
Node.js v22.11.0
User below command
npx @react-native-community/cli@latest init InsuranceApp
Recent Comments