Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error code: 800A1391 Source: Microsoft JScript runtime error Running Grunt - Module is undefined

Tags:

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
like image 292
JeffOnWire Avatar asked Jun 15 '12 23:06

JeffOnWire


2 Answers

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.

like image 79
Florian F Avatar answered Jan 03 '23 17:01

Florian F


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..)


Guide :
  1. Go to any javascript file with "js" extension. (any file)

  2. Right-Click(mouse) > Properties > "Opens with:" Change...(button)

  3. Choose Notepad ( or any javascript IDE ).

PROBLEM SOLVED ! :) good luck

like image 27
Lior Cris Avatar answered Jan 03 '23 16:01

Lior Cris