windows下使用hexo d指令将博客部署到github上时经常会报FATAL spawn git ENOENT错误,是因为使用cmd执行的这条指令,改成使用git bash执行就不会报错了。 报
windows下使用hexo d指令将博客部署到github上时经常会报FATAL spawn git ENOENT错误,是因为使用cmd执行的这条指令,改成使用git bash执行就不会报错了。
报错信息
FATAL spawn git ENOENT
Error: spawn git ENOENT
at notFoundError (C:/Users/Administrator/Desktop/Hexo/node_modules/hexo-depl
oyer-git/node_modules/hexo-util/node_modules/cross-spawn/node_modules/cross-spaw
n-async/lib/enoent.js:8:11)
at verifyENOENT (C:/Users/Administrator/Desktop/Hexo/node_modules/hexo-deplo
yer-git/node_modules/hexo-util/node_modules/cross-spawn/node_modules/cross-spawn
-async/lib/enoent.js:43:16)
at ChildProcess.cp.emit (C:/Users/Administrator/Desktop/Hexo/node_modules/he
xo-deployer-git/node_modules/hexo-util/node_modules/cross-spawn/node_modules/cro
ss-spawn-async/lib/enoent.js:30:19)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
解决方案:
之前使用cmd执行的hexo d ,改成使用git bash执行就成功了。