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: https://sonarcloud.io/documentation/upcoming/
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 install --yes nodejs
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...
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.
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.
...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...
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