Several problems running grunt.cmd in windows

I had to modify grunt.cmd because the path for my system was very wrong:

Initially:

%~dp0\Application Data\npm\node_modules\grunt

To print:

\\dacwnas\Profiles\<user>\Application Data\npm\Application Data\npm\node_modules\grunt

Running grunt.cmd will cause a module error. Changing it to %~dp0\node_modules\grunt" fixes the error.

But when you run grunt.cmd --version , nothing is displayed in the windows. It just pauses for a moment and returns to an empty command line.

I am running a 64-bit version of Windows 7 and the command line is starting as an administrator

+7
source share
2 answers

First you must install the grunt-cli globally:

 npm install -g grunt-cli 

Then make sure there is grunt in the project folder.

You can do it:

  • Make sure grunt is part of your package.json and run: npm install
  • Go to project folder and only npm install grunt

After that, you should have no problems starting Grunt.

+2
source

Have you installed grunt-cli?

My grunt.cmd content is as follows:

 :: Created by npm, please don't edit manually. @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\node_modules\grunt-cli\bin\grunt" %* ) ELSE ( node "%~dp0\node_modules\grunt-cli\bin\grunt" %* ) 
+1
source

All Articles