【问题标题】:Netlify deploy for Hugo starter fails with "spawn EACCES" error用于 Hugo 启动器的 Netlify 部署因“spawn EACCES”错误而失败
【发布时间】:2019-03-05 08:04:39
【问题描述】:

我已经使用 Netlify CMS Hugo Site Starter 建立了一个站点,它运行良好。
然后我从创建的存储库中取出文件并将它们移动到一个新的 Git 存储库,并基于该存储库创建一个新的 Netlify 站点。 突然部署在尝试启动 Hugo 时给了我一个错误:

10:03:37 PM: Starting 'hugo'...
10:03:37 PM: [21:03:37]
10:03:37 PM: 'hugo' errored after 14 ms
10:03:37 PM: [21:03:37]
10:03:37 PM: Error: spawn EACCES
10:03:37 PM:     at ChildProcess.spawn (internal/child_process.js:313:11)
10:03:37 PM:     at Object.exports.spawn (child_process.js:508:9)
10:03:37 PM:     at buildSite (/opt/build/repo/gulpfile.babel.js:81:13)
10:03:37 PM:     at Gulp.<anonymous> (/opt/build/repo/gulpfile.babel.js:23:27)
10:03:37 PM:     at module.exports (/opt/build/repo/node_modules/orchestrator/lib/runTask.js:34:7)
10:03:37 PM:     at Gulp.Orchestrator._runTask (/opt/build/repo/node_modules/orchestrator/index.js:273:3)
10:03:37 PM:     at Gulp.Orchestrator._runStep (/opt/build/repo/node_modules/orchestrator/index.js:214:10)
10:03:37 PM:     at Gulp.Orchestrator.start (/opt/build/repo/node_modules/orchestrator/index.js:134:8)
10:03:37 PM:     at /opt/build/repo/node_modules/gulp/bin/gulp.js:129:20
10:03:37 PM:     at _combinedTickCallback (internal/process/next_tick.js:132:7)

在 Netlify 部署的上下文中,我似乎找不到任何关于“spawn EACCES”错误的信息。
任何人有任何想法或之前可能遇到过这个问题?

编辑:澄清一下:
当我克隆原始的 Hugo Site Starter Git 存储库并使用它进行部署时,一切正常。
当我创建一个新的 Git 存储库时,提交+推送与克隆存储库完全相同的内容并尝试将其部署为站点,Netlify 返回spawn EACCES 错误。 我做了一个 Winmerge 来查找更改,唯一的更改是在 .git 文件夹中,因为我创建了一个新的存储库(所以它只有一个提交而不是 200+);代码是 100% 相同的。

【问题讨论】:

    标签: hugo netlify netlify-cms


    【解决方案1】:

    从您的存储库中删除 bin 文件夹和 follow this Answer

    它允许您在升级本地 Hugo 版本时更改 Hugo 版本。有理由将 Hugo 放在 bin 文件夹中,因为它占用的空间很小,但是在 Netlify 上托管时,我认为没有任何理由这样做。我试图跟踪该 bin 文件夹中的版本以及您遇到的问题增加了我不在存储库中保留可执行版本的原因。

    您需要在全球范围内运行本地版本的 Hugo 进行开发,但您可以按照 Hugo 文档了解如何执行此操作。

    【讨论】:

      猜你喜欢
      • 2016-02-17
      • 2021-08-11
      • 2022-09-09
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多