1

我正在尝试通过以下方式将我的 React 应用程序部署到 github 页面:

  1. 将更新推送到 Github
  2. 跑步npm run deploy

但我收到以下错误:

remote: warning: File static/media/db.bbef9ce0.gif is 55.87 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB                   
remote: warning: File static/media/website.a612b8be.gif is 73.98 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB              
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.        
remote: error: Trace: 5481bd86db186efed30eeeba2bbe31cb        
remote: error: See http://git.io/iEPt8g for more information.        
remote: error: File static/media/auto.6863815e.gif is 220.17 MB; this exceeds GitHub's file size limit of 100.00 MB        
To github.com:markoelez/personal_website.git
 ! [remote rejected] gh-pages -> gh-pages (pre-receive hook declined)
error: failed to push some refs to   'git@github.com:markoelez/personal_website.git'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! personal_website@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the personal_website@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

有问题的文件是我通过将它们的目录添加到我的文件中而gifs从我的 git 提交中排除的,但由于某种原因,它们导致部署失败。我可以毫无问题地将它们推送到 github。我该如何解决?/src/assets.gitignore

更新:所以我尝试使用git lfs但我最终遇到了同样的错误。有什么方法可以配置git lfs为使用 npm 部署?

4

0 回答 0