鱼C论坛

 找回密码
 立即注册
查看: 1832|回复: 2

[已解决]hexo部署到github时报错spawn failed

[复制链接]
发表于 2023-5-4 09:17:38 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x

报错截图

报错截图

_config.yml配置如下:
  1. # Hexo Configuration
  2. ## Docs: https://hexo.io/docs/configuration.html
  3. ## Source: https://github.com/hexojs/hexo/

  4. # Site
  5. title: Hexo
  6. subtitle: ''
  7. description: ''
  8. keywords:
  9. author: John Doe
  10. language: en
  11. timezone: ''

  12. # URL
  13. ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
  14. url: https://ZhihanXing39.github.io
  15. permalink: :year/:month/:day/:title/
  16. permalink_defaults:
  17. pretty_urls:
  18.   trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  19.   trailing_html: true # Set to false to remove trailing '.html' from permalinks

  20. # Directory
  21. source_dir: source
  22. public_dir: public
  23. tag_dir: tags
  24. archive_dir: archives
  25. category_dir: categories
  26. code_dir: downloads/code
  27. i18n_dir: :lang
  28. skip_render:

  29. # Writing
  30. new_post_name: :title.md # File name of new posts
  31. default_layout: post
  32. titlecase: false # Transform title into titlecase
  33. external_link:
  34.   enable: true # Open external links in new tab
  35.   field: site # Apply to the whole site
  36.   exclude: ''
  37. filename_case: 0
  38. render_drafts: false
  39. post_asset_folder: false
  40. relative_link: false
  41. future: true
  42. highlight:
  43.   enable: true
  44.   line_number: true
  45.   auto_detect: false
  46.   tab_replace: ''
  47.   wrap: true
  48.   hljs: false
  49. prismjs:
  50.   enable: false
  51.   preprocess: true
  52.   line_number: true
  53.   tab_replace: ''

  54. # Home page setting
  55. # path: Root path for your blogs index page. (default = '')
  56. # per_page: Posts displayed per page. (0 = disable pagination)
  57. # order_by: Posts order. (Order by date descending by default)
  58. index_generator:
  59.   path: ''
  60.   per_page: 10
  61.   order_by: -date

  62. # Category & Tag
  63. default_category: uncategorized
  64. category_map:
  65. tag_map:

  66. # Metadata elements
  67. ## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
  68. meta_generator: true

  69. # Date / Time format
  70. ## Hexo uses Moment.js to parse and display date
  71. ## You can customize the date format as defined in
  72. ## http://momentjs.com/docs/#/displaying/format/
  73. date_format: YYYY-MM-DD
  74. time_format: HH:mm:ss
  75. ## updated_option supports 'mtime', 'date', 'empty'
  76. updated_option: 'mtime'

  77. # Pagination
  78. ## Set per_page to 0 to disable pagination
  79. per_page: 10
  80. pagination_dir: page

  81. # Include / Exclude file(s)
  82. ## include:/exclude: options only apply to the 'source/' folder
  83. include:
  84. exclude:
  85. ignore:

  86. # Extensions
  87. ## Plugins: https://hexo.io/plugins/
  88. ## Themes: https://hexo.io/themes/
  89. theme: landscape

  90. # Deployment
  91. ## Docs: https://hexo.io/docs/one-command-deployment
  92. deploy:
  93.   type: git
  94.   repo: https://github.com/ZhihanXing39/ZhihanXing39.github.io.git
  95.   branch: master
复制代码
最佳答案
2023-5-7 15:06:34
你好,根据你提供的配置文件以及错误信息,我猜测报错可能是由于没有安装部署所需的依赖包或者配置文件中的错误导致的。建议按照以下步骤进行排查:

确认已经安装 hexo-deployer-git 插件,可以通过在命令行中输入 npm install hexo-deployer-git --save 进行安装。

确认配置文件中 deploy 部分的信息是否填写正确,repo 填写的地址需要与你的远程仓库地址一致。

确认本地仓库是否有变更,如有变更需要先进行提交,再进行部署。

如果以上步骤都没有解决问题,建议检查一下命令行提示的具体错误信息,或者提供更多相关信息以便更好地帮助你解决问题
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-5-7 14:54:44 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-5-7 15:06:34 | 显示全部楼层    本楼为最佳答案   
你好,根据你提供的配置文件以及错误信息,我猜测报错可能是由于没有安装部署所需的依赖包或者配置文件中的错误导致的。建议按照以下步骤进行排查:

确认已经安装 hexo-deployer-git 插件,可以通过在命令行中输入 npm install hexo-deployer-git --save 进行安装。

确认配置文件中 deploy 部分的信息是否填写正确,repo 填写的地址需要与你的远程仓库地址一致。

确认本地仓库是否有变更,如有变更需要先进行提交,再进行部署。

如果以上步骤都没有解决问题,建议检查一下命令行提示的具体错误信息,或者提供更多相关信息以便更好地帮助你解决问题
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-10 03:17

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表