Problem to solve
I have runners that are ignoring the specified Docker image in my CI configuration. Despite setting image: node:18.19-alpine
in my jobs, the runner always uses Node.js v16.20.2, which causes my builds to fail because my system needs. 18.x
Error when running linting:
$ npm run lint:api
> new-system-backend@1.0.3 lint:api
> npx eslint api --max-warnings 0 --report-unused-disable-directives
Oops! Something went wrong! :(
ESLint: 9.24.0
ConfigError: Config "config-prettier": Key "rules": Key "curly": structuredClone is not defined
What happened = structuredClone
is not defined in x16, Node add that API in x17
During installation, I get multiple warnings about unsupported engine, showing that my dependencies require Node.js 18+, but the environment is using Node.js 16:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@typescript-eslint/typescript-estree@8.29.1',
npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@typescript-eslint/utils@8.29.1',
npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'eslint@9.24.0',
npm WARN EBADENGINE required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
Why? Because the system is using node v18 in the install proccessing instead of 18
Steps to reproduce
- Defined
image: node:18.19-alpine
both globally and for individual jobs in .gitlab-ci.yml - Added echo statements to show the Node.js version, which consistently shows v16.20.2
- Added debugging statements to understand the environment
- Tried clearing cache, reinstalling dependencies
Configuration
image: node:18.19-alpine
stages:
- build
- test
check:api:
stage: test
image: node:18.19-alpine # This should force Node.js 18.19
script:
- echo "Node version, should be 18.19.0:"
- node --version # Shows v16.20.2 instead of v18.19.0
- npm --version
- npm ci --include=dev
- npm run lint:api # Fails with "structuredClone is not defined"
Versions
- Self-managed
-
GitLab.com
SaaS - Dedicated
- Self-hosted Runners
Versions
- GitLab: Latest*
Additional Information
Our project requires Node.js 18+ as our ESLint configuration and other tools use features not available in Node.js 16 (like structuredClone
).
I have two runners configured for this project:
- RUNNER_1742432542 (prismaprod-s)
- RUNNER_1742397591 (devprisma)
Both runners appear to be ignoring the specified Docker image and are using Node.js 16 regardless of the configuration.
Do you have any idea what could be the real issue? I can show the whole file in a privaty chat