Incompatible node version in hugo_extended image
Thank you again for addressing #75 (closed). Much appreciated @axil !
It looks, however, as if the chosen base image is not directly compatible with hugo's requirements. Specifically, when trying to generate pages, I am encountering the following issue:
❯ docker run --platform=linux/amd64 -v (pwd):/src -it registry.gitlab.com/pages/hugo/hugo_extended@sha256:7b4d8efc4aff389c1e446c71e3aad3462f64139ffd372f4c952cb9e425f0a8e1 sh
# apt update -qq
[...]
# DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends node-npm
[...]
# npm install autoprefixer postcss-cli
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'postcss-cli@10.1.0',
npm WARN EBADENGINE required: { node: '>=14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'fs-extra@11.1.0',
npm WARN EBADENGINE required: { node: '>=14.14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'postcss-load-config@4.0.1',
npm WARN EBADENGINE required: { node: '>= 14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'slash@5.0.0',
npm WARN EBADENGINE required: { node: '>=14.16' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'yaml@2.2.1',
npm WARN EBADENGINE required: { node: '>= 14' },
npm WARN EBADENGINE current: { node: 'v12.22.12', npm: '7.5.2' }
npm WARN EBADENGINE }
added 75 packages, and audited 76 packages in 13s
18 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
root@dac53d88cea1:/src# hugo
hugo: downloading modules …
hugo: collected modules in 41382 ms
Start building sites …
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended linux/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): /src/node_modules/yaml/dist/compose/composer.js:33
if (prelude[i + 1]?.[0] !== '#')
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/src/node_modules/yaml/dist/index.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code 1
npm ERR! path /src
npm ERR! command failed
npm ERR! command sh -c postcss "--config" "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.6.0/postcss.config.js"
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-03-13T01_02_04_045Z-debug.log
Total in 49247 ms
Which is, I assume, due to the old node version in the chosen base image.