ReactNative command to create a new app “npx react-native@latest init ProjectName” is not working on cmd but the same command if working when i use powershell.
This is the error i get:
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnode_modulesnpmbinnpm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.11.0
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnode_modulesnpmbinnpx-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.11.0
I am not able to understand what the issue is. I am able to run already running projects but not able to create a new one using Command Prompt.