部署到 GitHub 页面时收到错误

Ser*_*ker 5 github npm github-pages reactjs npm-build

我正在将反应应用程序部署到 git 中心页面并收到错误。gzip 后的文件大小:

68.67 KB  build\static\js\2.c2c334ae.chunk.js
 2.98 KB  build\static\js\main.8a72b1a2.chunk.js
  774 B   build\static\js\runtime~main.8f8a00a4.js
Run Code Online (Sandbox Code Playgroud)

该项目的构建假设它托管在/sort-customers-list/. 您可以使用package.json.

构建文件夹已准备好部署。要在https://sejob.github.io/sort-customers-list 上发布它,运行: npm run deploy

在此处了解有关部署的更多信息:

sort-customers-list@0.1.0 deploy 
C:\Users\SeJo\Documents\Code\DEV_HW\sort-customers-list
gh-pages -d build
Run Code Online (Sandbox Code Playgroud)

“文件”参数必须是字符串类型。接收类型未定义

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sort-customers-list@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sort-customers-list@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!    
C:\Users\SeJo\AppData\Roaming\npm-cache\_logs\2019-08-01T12_09_52_445Z-debug.log
Run Code Online (Sandbox Code Playgroud)

Ism*_*zan 5

问题出现在新版本的GitHub页面。只需使用此命令安装以前版本的 GitHub 页面:

npm install gh-pages@2.0.1
Run Code Online (Sandbox Code Playgroud)

希望它会有所帮助!