I have a pipeline created in Jenkins with the following configuration for a Nodejs application:
pipeline {
agent any
stages {
stage('Build') {
steps {
nodejs(nodeJSInstallationName: 'Node8') {
sh 'npm install'
}
}
}
stage('Test') {
steps {
nodejs(nodeJSInstallationName: 'Node8') {
sh 'npm run test'
}
}
}
stage('Deploy') {
steps {
nodejs(nodeJSInstallationName: 'Node8') {
sh 'npm run start'
}
}
}
}
}
But the execution of 'npm' is failing, which gives me the following error:
+ npm install
/usr/bin/env:'node': No such file or directory
I installed Jenkins on my server using Docker (image jenkins/jenkins:lts) and I installed the NodeJS plugin in Jenkins.
I created the Node tooling in this way:
Do you know what may be happening?
A greeting.