0
votes

I`m trying to compile some Less files using NPM and Grunt through the command line in a Nant script. For this I created 2 targets

1)

 <target name="npmInstall">
  <property name="core.nodeUtils" value="${core.source}\iFOREX Framework\IFOREX.Clients\iFOREX.Clients.Web\nodeUtils"/>  
  <exec program="C:\WINDOWS\system32\CMD.EXE" 
      commandline="npm install"          
      verbose="false" 
      workingdir="${core.nodeUtils}">
  </exec>

2)

<target name = "lessDeploy">
  <property name="core.nodeUtils" value="${core.source}\iFOREX Framework\IFOREX.Clients\iFOREX.Clients.Web\nodeUtils"/>  
  <exec program="C:\WINDOWS\system32\CMD.EXE" 
      commandline="grunt lessDeploy"          
      verbose="false" 
      workingdir="${core.nodeUtils}">
  </exec>
</target>

The first installs the relevant npm items in the relevant folder. The second actually runs the compilation using grunt .

For some reason the only output I`m getting is the below:

2015-07-01 12:09:05 Starting Build iFOREX.Framework.Integration.LessCompile 2015-07-01 12:09:06 Starting Target npmInstall 2015-07-01 12:09:06 Starting 'C:\WINDOWS\system32\CMD.EXE (npm install)' in 'D:\BuildAreas\Dev3\Source\iFOREX Framework\IFOREX.Clients\iFOREX.Clients.Web\nodeUtils' 2015-07-01 12:09:06 Microsoft Windows [Version 6.1.7601] 2015-07-01 12:09:06 Copyright (c) 2009 Microsoft Corporation. All rights reserved. 2015-07-01 12:09:06

It gets stuck on this output and the Nant script times out after the set 600 seconds.

Any idea what I might be doing wrong?

1
It's been a while since I ran it - does npm install require you to interact with it to confirm the install? - James Thorpe
No confirmation is needed , i ran it menially before adding it to Nant and it worked Flawlessly - Yonnatan Bar
Perhaps change verbose to true, see if you get any further information logged - James Thorpe
Did not help , its just stuck on 2015-07-01 12:56:28 Starting Build iFOREX.Framework.Integration.LessCompile 2015-07-01 12:56:30 Starting Target npmInstall 2015-07-01 12:56:30 Starting 'cmd.exe (npm install)' in 'D:\BuildAreas\Dev3\Source\iFOREX Framework\IFOREX.Clients\iFOREX.Clients.Web\nodeUtils' 2015-07-01 12:56:30 Microsoft Windows [Version 6.1.7601] 2015-07-01 12:56:30 Copyright (c) 2009 Microsoft Corporation. All rights reserved. 2015-07-01 12:56:30 - Yonnatan Bar
I wonder if prepending /C to the command line would have fixed this. It's not working for me so probably not I guess :) - sirdank

1 Answers

0
votes

I found a workaround that suits me. Instead of executing directly I created a batch script to perform the command execution and it appears to be working.