2017-08-17 65 views
0

我從來沒有用過gh-pages,所以我對它的工作原理感到困惑。我跟着this guide瞭如何部署您的應用程序的Git樞紐的創建作出反應的應用程序頁面上,但是每次我試圖我得到一個錯誤:創建React應用程序和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! [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. 

我不知道這意味着什麼或如何解決它。

+0

建立你的'master'分支,然後將資產複製到'gh-pages'分支。 'gh-pages'只是一個靜態網站,所以它只是想要你的HTML和JS。 – lux

回答

0

如果任何人有類似的問題,因爲git沒有添加到您的PATH。我在windows下運行npm run deploy命令提示符,當我在git shell中運行它時,它運行得非常完美。

相關問題