I am running the following docker image jenkinsci/jenkins:2.0-rc-1
to try out jenkins 2.0, and the \"pipeline\" view.
I can\'t seem to install node. Here\'s
Either
node {
withEnv(["PATH+NODE=${tool name: 'node-5.10.1', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
sh 'node -v'
}
}
or
node {
def nodeHome = tool name: 'node-5.10.1', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
sh "${nodeHome}/bin/node -v"
}
should work. See JENKINS-28718 for further proposals.
By the way you can omit the type
parameter and just use
tool 'node-5.10.1'
for brevity.