I previously installed node.js and mongodb and worked with it in vscode..Now I tried to install react but it is showing me error everytime…tried many utube tutorials..nothing worked…pls help
C:Windowssystem32> cd c:reactjs
c:Reactjs>npm init react-app my-app
'RABIAppDataLocalnpm-cache_npx34e2c46f4bd11602node_modules.bin' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:1078
throw err;
^
Error: Cannot find module 'C:Userscreate-react-appindex.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.15.0
npm ERR! code 1
npm ERR! path c:Reactjs
npm ERR! command failed
npm ERR! command C:Windowssystem32cmd.exe /d /s /c create-react-app my-app
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersSUSMITA & RABIAppDataLocalnpm-cache_logs2023-04-06T07_00_49_938Z-debug-0.log
2
Answers
Try this command
Based on the evidence
and
I’d guess that Npm isn’t quite compatible with the
&
sign in your username (which is a special character in shells).You may need to use another user with no
&
in the username, unless there’s some workaround.