Only Node.js v14.17 or later is supported, got 12.22.1

I have SonarQube in Docker.
Dockerfile:

FROM sonarqube:community

ENV NODE_MAJOR=21

USER root

RUN apt update
RUN apt remove nodejs
RUN apt autoremove
RUN apt update
RUN apt install -y ca-certificates curl gnupg
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt update
RUN apt install nodejs -y

USER sonarqube

docker-compose.yml:

version: "3"

services:
  sonarqube:
    build:
      context:    /opt/sonarqube.docker-compose
      dockerfile: /opt/sonarqube.docker-compose/Dockerfile
    user: sonarqube
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs
    ports:
      - "9000:9000"

  db:
    image: postgres:12
    environment:
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: sonar
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_logs:
  postgresql:
  postgresql_data:

I use SonqrQQube with Bitbucket Pipelines.
bitbucket-pipelines.yml:

image: maven:3.9.5

definitions:
  services:
    sonarqube:
      image: sonarqube:community

  pipelines:
    default:
      - step: &build-step
          name: SonarQube analysis
          script:
            - apt-get update
            - apt remove nodejs
            - apt autoremove
            - apt update
            - apt-get install -y ca-certificates curl gnupg
            - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
            - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
            - apt-get update
            - apt-get install nodejs -y
            - node -v  # Check Node.js's version
            - pipe: sonarsource/sonarqube-scan:1.0.0
              variables:
                SONAR_HOST_URL: http://sonarqube-nlb-<HEX_DIGITS>.elb.us-east-1.amazonaws.com:9000
                SONAR_TOKEN: sqp_<HEX_DIGITS>
                SONAR_SCANNER_OPTS: -Dsonar.java.binaries=. -Dsonar.exclusions=file:**/gensrc/**,**/ws/axis/*,**/*.css,**/*.json,**/*.xml,**/*.yml,**/*.less,**/*.jsp,**/*.js -Dsonar.extensions=drivenbrands -Dsonar.binaries=classes

  caches:
    sonar: ~/.sonar

clone:
  depth: full

pipelines:
  branches:
    '{master}':
      - step: *build-step

As you see I use NodeJS version 21.1.0, but SonarQube prints an error:

ERROR: Only Node.js v14.17 or later is supported, got 12.22.1.
org.sonar.plugins.javascript.nodejs.NodeCommandException: Only Node.js v14.17 or later is supported, got 12.22.1.

I don’t use NodeJS 12.22.1.
Where does SonarQube find NodeJS 12.22.1?
How to correct this error?

Thank you in advance.

Hi,

This version 1.0.0 was released in 2021. You could update it to the latest version: sonarsource/sonarqube-scan:2.0.1. I suppose the latest image includes a newer node.js version.

Thank you, Felipe!
It worked, but now I have:

INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=8ms
INFO: Sensor JavaScript/TypeScript analysis [javascript]
INFO: 77 source files to be analyzed
INFO: 12/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.navigation.js
INFO: 14/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.tabs.js
INFO: 14/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.tabs.js
INFO: 14/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.tabs.js
INFO: 15/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.futurelink.js
INFO: 15/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.futurelink.js
INFO: 15/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.futurelink.js
INFO: 15/77 files analyzed, current file: /opt/<PATH>/WEB-INF/_ui-src/responsive/lib/ybase-0.1.0/js/acc.futurelink.js
time="2023-11-02T19:38:09Z" level=error msg="error waiting for container: unexpected EOF"