I had to modify grunt.cmd because the path for my system was very wrong:
Originally:
%~dp0\Application Data\npm\node_modules\grunt
Which would print:
\\dacwnas\Profiles\<user>\Application Data\npm\Application Data\npm\node_modules\grunt
Running grunt.cmd would throw a cannot find module error. Changing it to %~dp0\node_modules\grunt"
removes the error.
But, running grunt.cmd --version
in windows outputs nothing. It simply pauses for a moment and returns to a blank command line.
I'm running Windows 7 64-bit, and the command line is run as administrator
The easiest way to add Grunt and gruntplugins to an existing package. json is with the command npm install <module> --save-dev . Not only will this install <module> locally, but it will automatically be added to the devDependencies section, using a tilde version range.
Installing the CLI. Run sudo npm install -g grunt-cli (Windows users should omit "sudo ", and may need to run the command-line with elevated privileges). The grunt command-line interface comes with a series of options. Use grunt -h from your terminal to show these options.
First, you should have the grunt-cli
package installed globally:
npm install -g grunt-cli
Next, make sure you have grunt
installed in your project folder.
You can do this by:
grunt
is part of your package.json
and run: npm install
npm install grunt
After this, you shouldn't have any trouble running Grunt.
Did you install grunt-cli?
My grunt.cmd content looks like that:
:: 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" %*
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With