Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GruntJs 'grunt' cmd opens Visual Studio?

I have been able to use GruntJs on several personal projects with zero problems. I decided I would use it on my project at work.

I run: grunt init:gruntfile and that creates the gruntfile and the package.json file just fine.

The problem is that whenever I run any grunt cmd grunt or grunt lint etc it immediately opens up Visual Studio and opens the gruntfile. Nothing actually happens. Example

Any idea what I am doing wrong?

like image 593
Mike Fielden Avatar asked Jun 07 '12 13:06

Mike Fielden


1 Answers

I didnt read the FAQ...

https://github.com/gruntjs/grunt/wiki/Frequently-Asked-Questions

If you're in the same directory as the grunt.js gruntfile, Windows tries to execute that file when you type grunt. So you need to type grunt.cmd instead.
An alternative would be to use the DOSKEY command to create a grunt macro, following these directions. That would allow you to use grunt instead of grunt.cmd. This is the DOSKEY command you'd use:

EDIT

Alternatively you could use the DOSKEY command:

DOSKEY grunt=grunt.cmd $*
like image 190
Mike Fielden Avatar answered Oct 02 '22 14:10

Mike Fielden