I tried to follow a reactJs tutorial, but it shows an error while deploying the code on Github pages. I tried to look for solutions but nothing is working. I am new to git and github so kindly help me with this error:
> [email protected] deploy D:\Full Stack CWH\React Js\my-first-app
> gh-pages -d build
events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at one rrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at one rrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn git',
path: 'git',
spawnargs: [ 'config', 'user.name' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\agarw\AppData\Roaming\npm-cache\_logs\2022-05-25T15_49_32_003Z-debug.log
PS D:\Full Stack CWH\React Js\my-first-app>
CodePudding user response:
Delete you package node_modules on you AppData/Roaming, re install.
CodePudding user response:
It just somehow didn't give the error the next day after I restarted my pc maybe restarting just fixed my problem.