I’m attempting to integrate Node.js into my Jenkins server to enhance my pipeline capabilities. Specifically, I want to utilize Node.js for various tasks within my Jenkins pipelines, such as running JavaScript-based tests or build scripts.
Despite successfully installing Node.js version 16.20.2 both globally on the server and within my Jenkins instance, I encounter an issue when running my Jenkins pipeline. The error message received is:
Error when running: 'node -v'. Is Node.js available during analysis? org.sonar.plugins.javascript.nodejs.NodeCommandException
This error suggests that Node.js might not be accessible during the analysis stage of my pipeline, even though it’s installed and working on my system.
Additional Information:
- Jenkins LTS version: 2.426.3
- Node.js version: 16.20.2
- Operating System: Amazon Linux 2
I’ve set the sonar.nodejs.executable
property in my sonar-project.properties
, but it’s still unable to find the Node.js executable
What should I do? I’m seeking guidance on resolving this issue and ensuring Node.js is properly available during the analysis stage of my Jenkins pipeline. Any insights or suggestions would be greatly appreciated.