module_not_found in ReactJS



我在初始化React项目(npm init react-app my-app)时面临以下错误

PS C:UsersAbbasi&Ayaztodo> npm init react-app my-app
'AyazAppDataRoamingnpm' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'C:UsersAbbasinode_modulescreate-react-appindex.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code 1
npm ERR! path C:UsersAbbasi&Ayaztodo
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:UsersAbbasi&AyazAppDataRoamingnpm-cache_logs2022-05-01T05_43_26_987Z-debug-0.log"

删除node_modules文件夹并运行npm install命令

请务必删除&

最新更新