Wednesday, 5 April 2017

Jenkins - Node JS + GitHub integration fails on windows 10 during build

I'm trying to configure continues integration for node js using Jenkins version 1.6

Step 1: I have configured NodeJS installations as below by keeping global configuration

Global Configuration

Step 2: My Job Configuration selection node global config here

Job Configuration

Step 3: My Job Console, it is fetching proper git repo while installing npm it fails Job Console

 > C:\Git\Git\bin\git.exe config core.sparsecheckout # timeout=10
 > C:\Git\Git\bin\git.exe checkout -f f1612bda9378e7f03738d142a5ce7c0d0a55f6c3
 > C:\Git\Git\bin\git.exe rev-list f1612bda9378e7f03738d142a5ce7c0d0a55f6c3 # timeout=10
Unpacking https://nodejs.org/dist/v6.9.0/node-v6.9.0-win-x86.zip to C:\Users\Selva\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node_v6.9 on Jenkins
[substack] $ C:\Users\Selva\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node_v6.9\node.exe C:\Users\Selva\AppData\Local\Temp\hudson640278178448032292.js
C:\Users\Selva\AppData\Local\Temp\hudson640278178448032292.js:1
(function (exports, require, module, __filename, __dirname) { npm install
                                                                  ^^^^^^^
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
Build step 'Execute NodeJS script' marked build as failure
Finished: FAILURE
    enter code here

If there is any mistake on which step i need to change,im using windows 10 machine with jenkins stable version

Here i have followed documentation of official jenkins wiki page. Node JS Plugin

Does anyone please help to resolve this Node JS + Github + Jenkins config



via rselvaganesh

No comments:

Post a Comment