HUGOのバージョン変更に伴いCloudflareのbuild構成を変更

hugoのバージョン変更

HUGOのバージョンを0.103.1から0.150.1に変更した際のメモです。

ERROR at cloudflare when deploying1

Installing Hugo 0.150.1 hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by hugo) hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by hugo) hugo: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by hugo) hugo: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by hugo) Failed: build command exited with code: 1 Failed: error occurred while running build command

対応

ビルドで使用しているマシンがHUGOのバージョンに必要なモジュールがないのが原因
Cloudflare の Pages の設定タブを開き ビルドシステム のバージョンを 1 から 3 に変更

ERROR at cloudflare when deploying2

Installing project dependencies: npm install --progress=false npm error code ENOENT npm error syscall open npm error path /opt/buildhome/repo/memo/package.json npm error errno -2 npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/opt/buildhome/repo/memo/package.json' npm error enoent This is related to npm not being able to find a file. npm error enoent npm error A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-09-27T06_24_53_611Z-debug-0.log Error: Exit with error code: 254 at ChildProcess. (/snapshot/dist/run-build.js) at Object.onceWrapper (node:events:652:26) at ChildProcess.emit (node:events:537:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12) Failed: build command exited with code: 1 Failed: error occurred while running build command

対応

build中のnpmでエラー
postcss.config.jsファイルを削除した。 このファイルは、「HUGOで作成したページでスタイルにcharsetが出力され、有効なAMPにならない」で作成したファイル。最終的に不要だったが残ったままだった。
ビルドシステム のバージョンの影響か、hugoのバージョン変更の影響か、エラーが再発生するようになった。 以前の記事のときは、完全にpostcssの処理が消せていなかったようだ。

Last Mod: 2025-09-27
Created: 2025-09-27