Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9200313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:44:18+00:00 2026-06-17T22:44:18+00:00

This thread ( Problem capturing error output ) gives you a taste of the

  • 0

This thread (Problem capturing error output) gives you a taste of the problem I’m struggling with. I’m trying to run grunt from MSBuild and the grunt errors are not displayed in the Visual Studio output window. I have a .NET project in Visual Studio Express 2012 for Web. I have imported an external project into the project build file with the IMPORT tag and in the imported project I have an Exec task attempting to run grunt. I obviously want to see the error messages that grunt outputs in my Visual Studio output window without too much fuss.
I found an extremely simple workaround that at least sends the output to a text file.

grunt.cmd > grunt-output.txt

This output file is in my .NET project folder somewhere so a quick refresh and double click allows me to open the output file and see a slightly garbled version of the grunt output in Visual Studio.

As an example I’m running a lint task on the grunt.js file, which contains things which JSHint would object to. I deliberately didn’t put a semi-colon after var hello and so you get the error message Missing semicolon.

From the command line I get a nicely formatted error message.

Running "lint:files" (lint) task
Linting grunt.js...ERROR
[L2:C10] Missing semicolon.
var hello

<WARN> Task "lint:files" failed. Use --force to continue. </WARN>

Aborted due to warnings.

When I run it from Visual Studio, the output file contains this cluttered format:

    [4mRunning "lint:files" (lint) task[24m
     Linting grunt.js...[31mERROR[39m
     [31m[[39m[33mL2[39m[31m:[39m[33mC10[39m[31m][39m [33mMissing semicolon.[39m
     var hello[31m[7m [27m[39m

     [31m<[39m[33mWARN[39m[31m>[39m [33mTask "lint:files" failed. Use --force to continue.     [39m [31m</[39m[33mWARN[39m[31m>[39m

     [31mAborted due to warnings.[39m

Does anyone recognise what all those square brackets and numbers are doing, and can anyone think of a command line switch or grunt switch or node.js switch that would interpret them and turn them into formatting? The don’t look like some kind of encoding, they look more like tags to suggest to the command line environment how to format the message. Please don’t suggest running some kind of regular expression replace function. I want something quick and easy otherwise it would become more trouble than it’s worth.

UPDATE: this link Output gets cut off if piped into another application is pointing to a problem further upstream in node dating back 10 months. While that’s getting sorted out it would be nice to at least get a more readable output file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:44:20+00:00Added an answer on June 17, 2026 at 10:44 pm

    This thread on the grunt message board Pipe-redirecting Grunt’s output is broken addresses this issue perfectly and provides a quick workaround while we wait for the overall issue to get fixed. They are escape codes to colour the output and the workaround is to use the –no-color option to remove colouring.

    When I run this command from MSBuild

    grunt.cmd --no-color > grunt-output.txt
    

    I get nicely formatted output with exactly the same content as the command line:

    Running "lint:files" (lint) task
    Linting grunt.js...ERROR
    [L2:C10] Missing semicolon.
    var hello 
    
    <WARN> Task "lint:files" failed. Use --force to continue. </WARN>
    
    Aborted due to warnings.
    

    I can live without the colour. It would be nice if this could be sent to the output window, though, because MSBuild throws what seems like an error in the build process when in fact it’s just JSHint tactfully hurting my feelings about my JavaScript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives
I'm having a problem where I receive this error: Exception in thread main java.lang.NullPointerException
I have a problem handling messages in a Thread. My run-method looks like this
A new problem emerged from this thread: jquery form validator never makes ajax call
Following from this thread: Another IE jQuery AJAX/post problem (please read the thread to
I using multilanguage solution from this thread Multilanguage in WPF But i have problem
This question is based on this thread . Problem: to access MySQL's manual when
I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
[Note: There is another thread about this problem but it did not answer the
I know there is a lot of thread about this problem but I dont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.