solryu solryu - 3 months ago 42
CoffeeScript Question

Pre-build event grunt on build server, not finding grunt

I have been using CoffeeScript files within a project and have installed grunt into the project to compile them.

I am using Grunt Launcher to compile the files manually, but I wanted to be able to do so automatically when the project is built. To this end I put the following in the pre-build event command line under the project properties:

CD $(ProjectDir)
grunt build

This seems to work locally, but when I commit to the build server it comes back with this error:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1063,5): error MSB3073: grunt build" exited with code 9009

My research suggest that this is essentially a file not found; I presume for grunt. Some posts (here and here) suggest that added the full path is the answer, but what is the full path for grunt? Is it something like:


Grunt is installed both locally in the project and globally on my PC. I'm using Visual Studio 2012.

Is there anyway to get the build server to run grunt?

Thank you in advanced for any help.

Answer Source

Thank you to anyone who had a look at this question.

After a bit of experimenting I found putting this into the pre-build event command line works:

CD $(ProjectDir)
cmd.exe grunt build
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download