Issue
I have a jenkins server that is configured using https://github.com/shierro/jenkins-docker-examples/tree/master/05-aws-ecs
I am running a blue ocean pipeline using a simple Jenkinsfile and the jenkins NodeJS plugin
pipeline {
agent any
tools {
nodejs 'node10'
}
stages {
stage ('Checkout Code') {
steps {
checkout scm
}
}
stage ('Install dependencies') {
steps {
sh "echo $PATH"
sh "npm install"
}
}
}
}
I made sure to add the node10 global tool as well w/c is used above
When the pipeline gets to the script sh "npm install"
i am running through this error
this is the output of the command echo $PATH
so i think it's not a path issue
Also, it also wasn't able to add the global package
More info that might help:
- Docker Jenkins server:
FROM jenkins/jenkins:2.131-alpine
- Blue ocean version: 1.7.0
- NodeJS Plugin: 1.2.6
- Multiple server restarts already
Any ideas why the jenkins server does not know where node is?
Big thanks in advance!
Solution
Thanks to @JoergS for some insight! The culprit in this case is: using alpine image as the docker base. So switching from jenkins/jenkins:2.131-alpine
to jenkins/jenkins:2.131
solved the NodeJS plugin issue.
Answered By - Theo