SonarScanner indicating nodejs 8 being used on node:14 docker image

Hi,

We are using Bitbucket cloud with a docker image to run sonarscanner on our commits.

We receive a notice that SonarScanner is no longer functioning on NodeJs 8. This is fully understandable, but we are on the node:14 image, so our NodeJs version should be well beyond version 8.

Below is our pipeline yml file.

image: node:14

clone:
  depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
  services:
    docker:
      memory: 2048  #increasing docker service memory
  steps:
    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        caches:
          - node
          - sonar
        script:
          - npm install --quiet
          - npm run-script build
          - pipe: sonarsource/sonarcloud-scan:1.0.1
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}
              EXTRA_ARGS: '-Dsonar.sources=src/app
                -Dsonar.tests=src
                -Dsonar.test.inclusions="**/*.spec.ts"
                -Dsonar.coverage.exclusions="**/node_modules/**,**/*.spec.ts"
                -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'

pipelines:                 # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
  branches:
    '{master,Acceptatie,Test,Development}':
      - step: *build-test-sonarcloud
  pull-requests:
    '**':
      - step: *build-test-sonarcloud

Is there something that should be changed to get this up and running again?
We know of the ability to force sonarscanner into accepting nodejs 8 for a few days, but that won’t fix the problem ofcourse.

Thanks for thinking along!

Hi @wzoet,

The configuration looks good to me. Can you update the sonarcloud-scan version? The one you have: 1.0.1 is a bit old as currently we have: 1.2.1 Bitbucket

Let me know if it changes anything

Best,
Marcin

Hi Marcin,

Sorry for the late reply, but your solution worked!
After updating to 1.2.1 the issue went away.
I presume we used an old deployment script example from somewhere.

Thanks for your help.

Regards,
Wim

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.