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

前端 未结 9 1315
臣服心动
臣服心动 2021-01-03 22:21

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 tas

相关标签:
9条回答
  • 2021-01-03 22:48

    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.

    0 讨论(0)
  • 2021-01-03 22:49

    If you're getting a "Microsoft JScript runtime error" that means that node.js isn't even getting invoked; instead Windows Script Host is trying to run your code. That's probably a problem with filetype associations; IIRC Windows defaults to trying to execute a ".js" file with WSH. You may wind up having to create a shortcut to your script, specifying a command line (probably something like "node %1") and a starting directory in order to make sure that it's executed properly.

    It would help if you could tell us exactly how you're trying to invoke your code.

    0 讨论(0)
  • 2021-01-03 22:49

    I had a similar issue, the problem is file association, I would recommend:

    • right click on a .js file and choose open with.
    • then you choose nodejs/node.exe (somewhere in "program files" folder
    • then make tick box where it says "always open .js files " (paraphrasing)

    That should do the trick.

    0 讨论(0)
提交回复
热议问题