New Grunt user here who is using a lot of new tools (npm nodejs) today.
I've got Grunt "installed" and have been able to create a grunt.js file using the init task as described here: http://net.tutsplus.com/tutorials/javascript-ajax/meeting-grunt-the-build-tool-for-javascript/ and here: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md. But whenever I run the "grunt" command I get an error:
Windows Script Host Script: c:\users\[]\Documents\code\grunt\grunt.js Line: 2 Char: 1 Error: 'module' is undefined Code: 800A1391 Source: Microsoft JScript runtime error
As explained in the FAQ, you need to type grunt.cmd
instead on Windows because the OS tries to launch grunt.js
Or you can install grunt-cli globally instead. This package will run any version of Grunt if it's been installed locally to your project.
SOLVED !!
So, this problem occur because windows by default associative < *.js > files with >> "Microsoft Windows Based Script Host".
grunt need to open by default with (grunt.cmd).
it easy to slove, by change default app (open with..)
Go to any javascript file with "js" extension. (any file)
Right-Click(mouse) > Properties > "Opens with:" Change...(button)
Choose Notepad ( or any javascript IDE ).
PROBLEM SOLVED ! :) good luck
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