我之前从未使用过gh-pages所以我对它的工作方式感到很困惑。我在创建反应应用页面上关注了this guide以了解如何将您的应用部署到git hub,但每次尝试我都会收到错误:
> gh-pages -d build
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn git ENOENT
at exports._errnoException (util.js:1018:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:505:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myApp_game@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myApp_game@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我不知道这意味着什么或如何解决它。
答案 0 :(得分:0)
如果有人有类似的问题,因为git没有添加到你的PATH中。我在Windows中从命令提示符运行npm run deploy,当我在git shell中运行它时,它工作得很好。