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

NodeJs plugin doesn't work on windows based Jenkins machine

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • nodejs-plugin
    • None
    • Windows 2012, Jenkins 1.552, and NodeJS Plugin 0.2.1

      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
      v0.10.26
      [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

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

              Created:
              Updated:
              Resolved: