Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21953

NodeJs plugin doesn't work on windows based Jenkins machine



    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nodejs-plugin
    • Labels:
    • Environment:
      Windows 2012, Jenkins 1.552, and NodeJS Plugin 0.2.1
    • Similar Issues:


      Using the instructions provided, I setup the plugin locally and point it to my existing installation of NodeJs (since it is a windows machine). I then setup my job to use an execute script to get my node version, which works. When I add a execute nodejs script to my build with this in it:

      var sys = require('sys');
      sys.puts('build number:' + process.env['BUILD_NUMBER']);
      sys.puts('current directory: ' + process.cwd());

      I get this error when I run the job:

      Building in workspace C:\Program Files (x86)\Jenkins\jobs\NodeJs\workspace
      [workspace] $ sh -xe C:\Windows\TEMP\hudson3559847244933178029.sh
      + node --version
      [workspace] $ C:\Windows\TEMP\hudson6840666181877118834.js
      %1 is not a valid Win32 application
      FATAL: command execution failed
      java.io.IOException: Cannot run program "C:\Windows\TEMP\hudson6840666181877118834.js" (in directory "C:\Program Files (x86)\Jenkins\jobs\NodeJs\workspace"): CreateProcess error=193, %1 is not a valid Win32 application
      at java.lang.ProcessBuilder.start(Unknown Source)
      at hudson.Proc$LocalProc.<init>(Proc.java:244)
      at hudson.Proc$LocalProc.<init>(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
      at jenkins.plugins.nodejs.tools.DecoratedLauncher.launch(DecoratedLauncher.java:49)
      at jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper$2.launch(NpmPackagesBuildWrapper.java:88)
      at hudson.Launcher$ProcStarter.start(Launcher.java:353)
      at hudson.Launcher$ProcStarter.join(Launcher.java:360)
      at jenkins.plugins.nodejs.NodeJsCommandInterpreter.perform(NodeJsCommandInterpreter.java:84)
      at jenkins.plugins.nodejs.NodeJsCommandInterpreter.perform(NodeJsCommandInterpreter.java:42)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565)
      at hudson.model.Run.execute(Run.java:1670)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)
      Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.<init>(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 19 more
      Build step 'Execute NodeJS script' marked build as failure
      Finished: FAILURE


          Issue Links


            jessesanders Jesse Sanders created issue -
            fcamblor Frédéric Camblor made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-21726 [ JENKINS-21726 ]
            icoulter Iain Coulter made changes -
            Link This issue is related to JENKINS-26828 [ JENKINS-26828 ]
            marcohj Marco Herrera Jimenez made changes -
            Assignee Deluan Quintão [ deluan ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 154030 ] JNJira + In-Review [ 178663 ]
            nfalco Nikolas Falco made changes -
            Assignee Deluan Quintão [ deluan ] Nikolas Falco [ nfalco ]
            nfalco Nikolas Falco made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]


              nfalco Nikolas Falco
              jessesanders Jesse Sanders
              7 Vote for this issue
              15 Start watching this issue