npm ERR! syscall spawn git

3.9k views Asked by At

I have a problem When I install thirdweb-dev/react i get this

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ELZAHBIA\AppData\Local\npm-cache_logs\2022-05-08T16_00_11_597Z-debug-0.log)

https://i.stack.imgur.com/ccD9N.png

2

There are 2 answers

1
Burhan On

Make sure you have the GIT installed on your device and accessible globally. Try to type git --version in the CMD. If it returned that the command is not recognized and GIT is already installed, then you need to add it to the PATH environment variable and make sure to try the command using a new CMD session.

0
Guerchen On

I had the same problem and it was related to not having the node packages of npm on my PATH. This solved the problem for me: npm global install does not add packages to PATH on Windows 8.1