npm install returns syscall spawn git error

喜你入骨 提交于 2020-08-05 08:57:43

问题


I've tried to run npm install and faced these issues below

I've tried to clear cache with force command, install git and update node but nothing worked

here is the error

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
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\UserName\AppData\Roaming\npm-cache\_logs\2019-11-01T11_56_42_862Z-debug.log

Can someone help me resolve this?


回答1:


Make sure you have the GIT installed on your device and accessible globally. Try to type git -v in the CMD. If it returned that the command is not recognized and GIT 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



来源:https://stackoverflow.com/questions/58658954/npm-install-returns-syscall-spawn-git-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!