[HAP-1127] Support NodeJS plugin Created: 10/Jan/19  Updated: 24/Mar/19  Resolved: 16/Jan/19

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 3.0.0
Fix Version/s: 3.1.0

Type: New Feature Priority: Normal
Reporter: Yahav Itzhak Assignee: Yahav Itzhak
Resolution: Fixed Votes: 0
Labels: None


Support configuring node tool from nodejs plugin and using it in the npm pipeline steps.

def rtNpm = Artifactory.newNpmBuild()

rtNpm.tool = "NodeJS-10"

Comment by Girish [ 21/Mar/19 ]

Getting the error using rtNpm install. Not sure what should be path argument. 

/jenkins/workspace/myproject is the location of the Git pulled project and location of the package.json

Snipped in Jenkins job is as below

rtNpm.resolver server: artServer, repo: 'remote-npm-public'
rtNpm.tool = 'NodeJS11'
def buildInfo = rtNpm.install path:'.'


Getting error 

Cannot run program "npm" (in directory "/jenkins/workspace/myproject/."): error=2, No such file or directory [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline java.lang.RuntimeException: npm build failed at org.jfrog.hudson.pipeline.common.executors.NpmInstallExecutor.execute(NpmInstallExecutor.java:49) at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:53) at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:36) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE


Can you help with correct path arguments? or is there any bug?

Comment by Yahav Itzhak [ 22/Mar/19 ]

Thanks for reporting this issue, Girish.

Please help us investigating this issue by specifying:

  1. Your Jenkins Artifactory plugin version.
  2. Does you clone your project before running "rtNpm.install"? I mean - Does "/jenkins/workspace/myproject/" exist?
  3. Have you configured "NodeJS11" tool properly in the Jenkins configuration?
Comment by Girish [ 22/Mar/19 ]

Please find response below

  1. Your Jenkins Artifactory plugin version. --> 3.0.0
  2. Does you clone your project before running "rtNpm.install"? I mean - Does "/jenkins/workspace/myproject/" exist? --> Yes, project is cloned. We run sh "ls -al" and the folder structure is displayed in Jenkins log
  3. Have you configured "NodeJS11" tool properly in the Jenkins configuration? --> Yes, this is configured in Jenkins - Yes, please refer below
Comment by Yahav Itzhak [ 22/Mar/19 ]

This feature introduced in 3.1.0 (See the fix version of this ticket) and stabilized in 3.1.1.

Please upgrade to the latest version (Currently 3.2.1).

We'll appreciate your feedback for that.

Comment by Girish [ 22/Mar/19 ]

Thanks for quick response. However we cannot see 3.1.1 in the Cloudbees Jenkins plugin center. We might have to wait for Cloudbees to make it available

Comment by Girish [ 22/Mar/19 ]

Current installed version of Cloudbees Jenkins is Does this support Plugin 3.1.1?

Comment by Yahav Itzhak [ 24/Mar/19 ]

[here|http://updates.jenkins-ci.org/download/plugins/artifactory] you can find all versions of Jenkins Artifactory plugin.

However, you are strongly recommended to download the latest through Cloudbees Jenkins plugin center.

Generated at Mon Jun 01 19:45:42 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.