Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Installing Node.js v10 doesn't seem to work, installing v9 instead

We are using SonarScanner to scan our .NET Core applications during build.  This tool has upgraded its required Node.js version to v10 instead of v9.  

ERROR: Error during SonarScanner execution
The version of node.js (9) you have used to run this analysis is deprecated and we stopped accepting it. Please update to at least node.js 10.
Temporarily you can set the property 'sonar.scanner.force-deprecated-node-version-grace-period' to 'true' to continue using node.js 9
This will only work until Mon Feb 15 08:00:00 UTC 2021, afterwards all scans will fail.
You can find more information here:
The SonarScanner did not complete successfully
16:36:18.584 Post-processing failed. Exit code: 1

Here are the commands that run in the pipeline before sonarscanner runs.

apt-get update
apt-get install --yes nodejs
node -v

In the install, here are the final output lines...

Setting up libbrotli1:amd64 (1.0.7-2+deb10u1) ...
Setting up libc-ares2:amd64 (1.14.0-1) ...
Setting up libuv1:amd64 (1.24.1-1) ...
Setting up libnode64:amd64 (10.23.1~dfsg-1~deb10u1) ...
Setting up nodejs-doc (10.23.1~dfsg-1~deb10u1) ...
Setting up nodejs (10.23.1~dfsg-1~deb10u1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for libc-bin (2.28-10) ...

 So I would imagine this means that v10.23.1 should install.  But when the version output command is run...

node -v

Is there something I am missing here that v10.23.1 doesn't get installed?

I will add that I am not a Node.js expert, just using it because SonarScanner needs it.

1 answer

First, just in case its an option to put the scan into a pipeline step of it's own: SonarSource also has Docker Images for the Scanner which can be used in a Pipeline step: sonarsource/sonar-scanner-cli - I had this working in the one or other bitbucket pipeline stable.

Having a pipeline step of it's own for the scan task may require you create artifacts in the previous steps so that the scanner can take them in (e.g. code coverage data etc.).

For the problem with the node version:

If you look at this message:

`update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode`

the alternative is set for the `js` utility, this is why the `node` utility is not affected.

that is the explanation only thought. I don't have a debian system at hand right now to quickly pull the command line to set this up.

a quick and dirty variant might be:

rm -f /usr/bin/node ; ln -sfT /usr/bin/nodejs /usr/bin/node

remove /usr/bin/node (in case it exists) ; symlink nodejs to node.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

221 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you